homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

How would you setup XHTML templates in MySQL?
JAB Creations

 5:45 pm on Nov 30, 2011 (gmt 0)

I'm looking in to adding template support in my software and I'd like some insight from others how they would or even have implemented it. I'm talking more in the context of conceptual, not the actual MySQL structure at least directly such as field types unless someone considers that relevant to the conceptual aspects.

Here are my current notes...






type: header,footer?


Standalone might be in example a small part of the page for advertising, e.g. it's root most element is completely contained inside of that template item.

Type would be header or footer though it might be something else.

Validity is (X)HTML related, if it's not been validated it can't be used. I think I might have a second XHTML field for updates pending re-validation.

My goal is to have the template system as flexible as possible and even include the ability to have several template items be used simultaneously on a single page for modularity.

...and I'm not using third party software however I have nothing against considering good features of other people's software.

Thoughts please?

- John



 4:46 pm on Dec 1, 2011 (gmt 0)

You might have a look at how modX does it. You can create templates, but they are minimal because they are often incorporated with another resource, "chunks." Chunks can be anything, but they are static (headers, footers, redundant data. . . .) Enter third resource, "snippets" that allows you to incorporate small PHP snippets that are evaluated and executed - for anything not covered by a plugin.

So you can have a plugin that outputs menus (getResources, among other things) and put a call to the plugin inside a chunk, and reference the chunk in the template.

Enter a fourth resource, template variables, which are similar (but far superior) to Wordpress "custom fields." You assign the T.V.'s to a given template, and they become available to any document resource using that template. For example, "main page" TV's would have different functions that internal page TV's.

modX is truly a coder's CMS, bcause it's so customizable with short PHP snippets, but once set up is easy beans for the non-tech personnel managing it. It has it's down sides but still better than most O.S. wares out there.

JAB Creations

 8:52 pm on Dec 1, 2011 (gmt 0)

Thanks rocknill. I've decided to go with a single template "set" per page and then allow however many template "items" to be added to any given "set". The template set is a list with content where items be can arranged before or after the content item without a limit to the number of template items added to a template set. It's a very simple yet powerful way I think to allow flexibility. Your input helped, thank you very much! :)

- John

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved