Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ending HTML line in a template

Status
Not open for further replies.

cabernet

Technical User
Feb 24, 2003
75
0
0
PK
Hello,
I have an OOP system based on my templates
I would like upgrading the system and offering color changes via bgcolor=
So instead of
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" valign="top" bgcolor="#ffffcc">

I would like doing:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" valign="top" <!--{BGCOLOR_1}-->

As is it works in IE and Netscape

However I am not 100% satisfied because of a little unsettled question:
To be correct the line should end:
valign="top" <!--{BGCOLOr_1}--> > with a second “ > “ which is the complementary “ > “ normally used to close the line.
BUT by doing so obviously the second “ > “ does show .. Not an option!
So I deleted it and it works fine but for the respect of pure HTML coding the last “ > “ is missing although not creating a problem

What are your thoughts?
Thanks
 
I think it is not the best choice to define the placholders as <!--{varname}-->. That - as you found out - is asking for trouble.
I would adjust the template class to use something like {!varname!} which has no HTML semantic meaning.

Another way to go is to remove unresolved placeholders before serving the page. A regular expression removing all <!--{whatever}--> should do.
 
Thank you
That was fast
regex sounds like a good option

 
FYI
I ended by modifying my main governing class
='{' .$key. '}';
instead of
='<!--{'.$key.'}-->';

that did it
thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top