pagetree inherit
Permalink 1 user found helpful
as it seems page attributes can not be inherited to child pages i am a little bit curious as you folks would solve a simple task.
(i am completly new to c5 but as always seem to directly run into limitations :)
mission:
a website with different section - to keep it simple say:
website.com
- website.com/male
- website.com/female
every branch has a gazillion of subpages so you don't want to edit every subpage.
background-color should be blue for boys and pink for girls (as one should expect :)
sounds trivial to me coming from typo3 - but not so in c5 i guess ...
any hints how to do this?
(i am completly new to c5 but as always seem to directly run into limitations :)
mission:
a website with different section - to keep it simple say:
website.com
- website.com/male
- website.com/female
every branch has a gazillion of subpages so you don't want to edit every subpage.
background-color should be blue for boys and pink for girls (as one should expect :)
sounds trivial to me coming from typo3 - but not so in c5 i guess ...
any hints how to do this?
does exactly was i was looking for - thanks for the quick respone.
One quick note, the code I gave you a slightly outdated...it still might work...but the better way is to not use the "isset" function.
So change everywhere it's used from this:
To this:
So change everywhere it's used from this:
if(isset($bgColor))
To this:
if($bgColor)
1.) Create a separate Page Type, one each for Male and Female. Set your background color based on the page type, this will apply to every page of that type.
2.) You can use a Page Attribute to select a color and then from within your template, you can programatically apply that color as the background, and if the attribute is not set, you can make it grab the attribute from the parent page, if not set there, go up again all the way through the sitemap until it finds a page with the attribute set to get the color from. Like this:
Once you have the color, you can apply it wherever you need.