3212 Posts in 847 Topics by 809 members
| Go to End | Next > | |
| Author | Topic: | 3544 Views |
-
Help with header

6 October 2009 at 5:49am
Can someone please explain how i can make the header image that changes when u change page
homepage - header 1
products - header 2
1st product group - header 3
2nd product group - header 4and so on...
-
Re: Help with header

6 October 2009 at 7:36am
The header area must be in cms to edit before content. i understand that i need to add some lines in page.php under mysite but dont know what kind.
-
Re: Help with header

6 October 2009 at 7:51am
Hi Webdoc
All you need to do is add an ImageField so that users can attach an image to the page. So to do that your Page class would look like this:
class Page extends SiteTree {
public static $has_one = array(
'BannerImage' => 'Image'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new ImageField('BannerImage', 'Banner image'),'Content');return $fields;
}
}Then in your template you can use $BannerImage to call the image or <% control BannerImage %>$CroppedImage(20,20).URL<% end_control %> etc. etc.
Hope that helps
Aram
-
Re: Help with header

6 October 2009 at 7:56am
almost aram but im using flash embed code so image is not right.
-
Re: Help with header

6 October 2009 at 8:02am
When you say flash embed code are you using SWFs? if so I tend to use a FileIFrameField instead of an ImageField and 'File' instead of 'Image'
-
Re: Help with header

6 October 2009 at 8:04am
Surely the size is set in the embed code?
basically you are going to be using the CMS to set the URL of the flash object, the size will be hard coded into the template flash code, or am I missing something?
| 3544 Views | ||
| Go to Top | Next > |


