You are here: Re: define my own "tags" for quick altering site layout « PHP Programming Language « IT news, forums, messages
Re: define my own "tags" for quick altering site layout

Posted by Sanders Kaufman on 09/24/07 09:52

"Kai Schlamp" <stroncococcus@gmx.de> wrote in message
news:1190554783.204395.89330@w3g2000hsg.googlegroups.com...
> Hello!
>
> I am thinking of a way to define my own tags like <my_tag> or {my_tag}
> or something like that, and later substitute these with real html
> code.

HTML doesn't allow you to make your own tags - although it handles them
well.

It sounds like XML/XSLT is what you're looking for here.
XML, on the other hand, is almost nothing *but* user-defined tags.
XSLT is the XML-equivalent of style-sheets, and lets you specify how the
elements will be displayed.

If you do that then, from the user's perspective, it'll appear just like any
HTML page - while still being W3C-compliant.



>
> For example, lets say I have a code snippet:
> {content_title}The Title{/content_title}
>
> Before echoing it out, I would do the following substitution:
> {content_title} = <table class="title_table"><th><td>
> {/content_title} = </td></th></table>
>
> This is a very simple example. But in a big site with many of the same
> components, such a scheme would make sense to alter the page layout
> pretty quick.
> Are there some helper classes or functions, or perhaps a whole package
> already for such a task?
> Or should I simply create the content with my tags and then subsitute
> all my tags with the real html code via preg_repalce function before
> printing it out? If yes, are there any better performance options
> instead of using preg_replace?
>
> Kai
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация