template creation based on existing template

Use GitHub to post feature requests for phpwcms.
Locked
User avatar
habi
Posts: 166
Joined: Sun 15. Feb 2004, 13:39
Location: Rutschwil, Switzerland
Contact:

template creation based on existing template

Post by habi »

Hi

In the creation of my current webproject I found it usefull if I could create a new template based on a existing template and just fill in the fields which content is different.

Then if you change some part (perhaps the footer) then all related templates are affected and you don't have to update all templates.
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

use external files when you want to have this like

Code: Select all

{PHP:footer.tmpl}
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Post by isac »

Oliver,

Does {PHP:something...} will slow down to much to create content? (render Page) Will be in memory cash?

thanks
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

No - will not slow down much. But you can test it by enabling the timer function in index.php.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

Oliver Georgi wrote:use external files when you want to have this like

Code: Select all

{PHP:footer.tmpl}
Oliver
hi oliver, interesting idea :) do you have an example?
'welcome to the real world!' datensysteme-lenk
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Put this into template's footer field - and put all stuff in footer.tmpl you would normally fill in the footer field.

Then a change in footer.tmpl is available for all templates using {PHP:footer.tmpl}

Try it ;-)
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

could i implement a template-system for my customer with that? over a menu switch?
'welcome to the real world!' datensysteme-lenk
duergner
Posts: 139
Joined: Fri 14. May 2004, 12:10

Post by duergner »

Should works when the footer.tmpl is a PHP file which will change the output depending on some available variables I think.
Nate
Posts: 42
Joined: Sun 11. Apr 2004, 18:26

Post by Nate »

Would be handy to have a "copy template" function, so that one could duplicate an existing template before making changes that one might wish they didn't make.
To fathom hell or soar angelic...
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

There will be implemented a template file editor later.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Locked