3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 492 Views |
-
Header image based on URLSegment

6 August 2011 at 7:15am
Hello,
I want to use a different header-image based on the url-segment of the page.
I've found some forumposts about this theme, but there it's up to the user to choose a headerimage in the backend. It's my aim to automate this.So I've put this in my Page.ss
<div id="header">
<img src="$ThemeDir/images/PageLeerling/titelafbeeldingen_leerlingen/$URLSegment.png" alt="" name="achtergrond_header" id="achtergrond_header" />
</div>I've prepared the different headerfiles according to the url segments.
But when I look in the sourcecode of the rendered page, I see this:
<div id="header">
<img src="themes/guatemala/images/PageLeerling/titelafbeeldingen_leerlingen/" alt="" name="achtergrond_header" id="achtergrond_header" />
</div>so apparantly $URLSegment isn't picked up.
Is it possible to achieve this whitout coding in the controller? Or, if so, what do I have to do?
Thanks.
-
Re: Header image based on URLSegment

6 August 2011 at 7:29am
As so often, I found the answer just after posting the question.
I had to 'escape' the placeholder with {}, so {$URLSegment} did the trick
| 492 Views | ||
|
Page:
1
|
Go to Top |
