Theme that allows different header image for each page
Permalink
Howdy,
I really like the Yosemite theme - but I need something that allows _easy_ setting the header image per page or per page type
Any hints?
Thanks
Oskar
I really like the Yosemite theme - but I need something that allows _easy_ setting the header image per page or per page type
Any hints?
Thanks
Oskar
You can use page attributes.
1. Go to the dashboard
2. Under page and themes go to Attributes
3. Choose img/file
4. give it a handle and name (the handle you will need to use in your code)
On the page type that you are using do the following
In the dashboard go to Page Types. Select the page type where you want to use the header image (click on settings). Under default attributes mark the checkbox header image or whatever name you have given earlier.
Now when you add a new page with that page type you will find header image in the tab "custom attributes". Here you can chose an image that will be shown on that page.
1. Go to the dashboard
2. Under page and themes go to Attributes
3. Choose img/file
4. give it a handle and name (the handle you will need to use in your code)
On the page type that you are using do the following
$ih = Loader::Helper('image'); // load the image helper $header_img = $c->getAttribute('header_image'); //get the attribute (by handle name); $img = $ih->getThumbnail($header_img, 1920, 800); <!-- in the html --> <img class="header-img" src="<?php echo $img->src ?>" alt="header-img">
In the dashboard go to Page Types. Select the page type where you want to use the header image (click on settings). Under default attributes mark the checkbox header image or whatever name you have given earlier.
Now when you add a new page with that page type you will find header image in the tab "custom attributes". Here you can chose an image that will be shown on that page.
thanks folks.
2 things, I cannot do that in code, due to someone else maintaining the site, it is mandatory that the image can be added/changed by means of the CMS UI.
I now went ahead and got Foundation5 - that seems to provide what I need
Thanks
Oskar
2 things, I cannot do that in code, due to someone else maintaining the site, it is mandatory that the image can be added/changed by means of the CMS UI.
I now went ahead and got Foundation5 - that seems to provide what I need
Thanks
Oskar
I don't know much about concrete5 5.6, so I am not sure how hard it would be to do. This can be done in 5.7 though.
If given instructions, would you be able to do it yourself or would you need a developer?
What type of project is this for?