Page 1 of 1

template variable

Posted: Mon Dec 22, 2008 3:50 pm
by carterbeech
Is there a way to add a variable to a page template so that I could have it read the parent section name and provide a different header or image without having to generate new template?

something like

img src="images/{parent}-header.jpg"

thanks.

Re: template variable

Posted: Sun Feb 22, 2009 5:29 am
by Shanma
I haven't tried it yet, but this plugin sounds like it does what you want:

http://dev.cmsmadesimple.org/projects/sectionimage
"This plugin allows you to add an image to your site that displays according to the site section."

Hope this helps.

Re: template variable

Posted: Wed Feb 25, 2009 7:12 pm
by chimmyc
Sectionimage is probably what you're looking for, yeah.

A quick and dirty way I've used in the past is to use something like img src="{Title}.jpg" in the template. This is less flexible, and less elegant, but works for most applications.