5411 Posts in 1648 Topics by 1187 members
|Go to End|
23 July 2009 at 11:57pm
My website has two distinct sections ("cars" and "bikes"), so I have made CarsHolder and BikesHolder page types with corresponding children. Each section has a different image. However, for pages which can't be CarsArticle or BikesArticle (ie User Defined Forms), I could do with some code to go onto Page.ss which will automatically select the correct image based upon the Parent page type.
ie: A User Defined Form with "CarsHolder" as it's parent will load an image of the car for its header.
I had hoped that something along the lines of the code below would work, but I don't know the correct code:
<% if $Parent = CarsHolder %>
<% else %>
<% end_if %>
Any pointers greatly appreciated
31 July 2009 at 4:39pm
Maybe try something like this:
<% control Level(1) %>
<div id='Header' class='$ClassName'>$Title</div>
<% end_control %>
the Level(1) control will get the root ancestor, so it'll work in sub sub pages where Parent won't. Just change the CSS to use BikesHolder and CarsHolder instead of bikesheaderpic carsheaderpic.
Just noticed this post is a bit late, but hopefully at least someone will find it helpful
|Go to Top|