|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
| Sponsored Links |
|
|
|
|||||
|
This depends, largely, on how you have built your CMS. You can make it as simple as including a header and footer on every page and the user could change these (this is how vBulletin works). You could pass all data to a template file that simply extracts and uses what data it needs (this is how Joomla! works). You could take a look at the smarty framework and replicate their template system (they use a bunch of .spl files or something similar that is very irritating to work with).
There are many more methods. John may tell you his method that he uses for his CMS.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||||
|
I am not 100% sure what we are doing right now to include templates, but the last I knew we were storing data in a database on what to gather for each page like headers, footers, widgets, modules, etc. John will be able to elaborate much more than I can. I know that we are implementing the model view controller design pattern.
|
|
|||||
|
I actually use smarty as a template engine as it's called,and I'm very pleased with it.
it uses .tpl files and contains all the html and info from the actual page sent by a special variable system. the main thing is that you can do different tpl:s for the same page, and as you write your output in the tpl, you can have a large setup of themes as many cms:es call it. |
|
|||||
|
Smarty is has to be one of the most asinine creations I know of. What the hell good is using a custom syntax just to run every tpl file through a smarty defined parsing function to convert that custom syntax back to php? That defeats the entire purpose of php to begin with.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
| Sponsored Links |
|
|
|
|||||
|
Quote:
![]() |
|
|||||
|
Quote:
in this way, you can, with the same code, in an very easy way, make totally different layouts with the same data, even for two users at the same time. maybe there are better template engines, That I can't tell, but I've found the smarty engine to work well for me, then I can create my coding, and then a designer can work with the tpl-files how they like without disturbing the code at all, just inserting variables (and a few control parameters) into their design-html-code. maybe you have some good suggestions of how to create layout templates in other ways? |
|
|||||
|
Quote:
I have never used it, but phpSavant does not compile the template which makes a whole lot more sense to me.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||||
|
Well, of course you have a point there about compiling. If I were new to using templates, your suggestion, phpSavant would probably be a better choice than Smarty, nor that I have used it either, so it would be up to each and everyone to choose.
I'm although very pleased with the Smarty system, and it works well for me. I don't think, that with todays better and better machines even in hosting, the execution time for doing compilages and stuff gets less relevant as the development goes, not saying that you do not would like a fast executable code because of this ... What do all these large cms systems do to make different themes, as I don't think they are using either Smarty or phpSavant? what is practical when building something like an cms and you want it to be easily redesigned? |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| class prototype and template error | hellochar | C and C++ | 7 | 07-17-2008 12:15 AM |
| DoublyLinkedList from hell | nolsen01 | C and C++ | 2 | 05-13-2008 03:55 PM |
| using Template function | Chinmoy | C Tutorials | 4 | 04-03-2008 05:16 AM |
| Anybody use SMARTY template system? | Dan | Website Design | 7 | 07-27-2006 12:25 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%