Assign a different header image per page
Previous article Next articleA recurring question at the CMS Made Simple™ forum is how to show a different header image for each website page. In this article I will show some examples how this can be done. Choose the one that best suits your purpose.
How to use
Method 1
Each CMSMS page has its own page alias, you can use {$page_alias} to show it. When you create an image - with the page alias as filename - for every page of your website, you can use it to change your header image like this:
<img src="{uploads_url}/images/header/{$page_alias}.jpg" alt="foo" />
</div>
A disadvantage is you can't set a default image, so don't forget to create a new image when you make a new page.
Method 2
Similar method as #1, but now used in combination with a stylesheet. An avantage is you can use the same image for multiple pages.
In your stylesheet you can attach an image to the classes:
background: url([[uploads_url]]/images/header/some-image.jpg) no-repeat;
}
.about-us,
.contact {
background: url([[uploads_url]]/images/header/another-image.jpg) no-repeat;
}
Method 3
In this method I use the CMSMS core {page_image} tag.
This tag returns the content of the Image field you will find in the options tab of the page editor. This is a dropdown containing the images in the selected folder. The user can choose an image for each page.
In this example I have used the folder uploads/images/header.
Go to Global Settings in the Admin Panel and open the tab Content Edit Settings.
In the field Path for image field you need to fill in the name of the folder containing the header images: "header".
If you want to show the Image field in the first tab of the page editor, select Image in the Basic Properties field of the same tab.
In your HTML-template you can use:
<img src="{uploads_url}/images/header/{page_image}" alt="foo" />
</div>
Or with a default image, i.e. "default.jpg":
{page_image assign='page_image'}
<img src="{uploads_url}/images/header/{$page_image|default:'default.jpg'}" alt="foo" />
</div>
Method 4
In this example we create a new content block in your page editor, containing a dropdown field.
Again I have used here the folder uploads/images/header.
Go to Global Settings in the Admin Panel and open the tab Content Editing Settings.
In the field Path for {content_image} tag you need to fill in the name of the folder containing the header images: "images/header".
In your HTML-template you can use:
{content_image block='header_image' label='Header Image'}
</div>
Or with a default image, i.e. "default.jpg":
{content_image block='header_image' default='default.jpg' label='Header Image'}
</div>
Comment Form
ReviewManager
ReviewManager
4 Comments
https://dcshop.vip
This information is priceless. When can I find out more?
https://dcshop.biz
Thanks for your marvelous posting! I certainly enjoyed reading it, you're a great author.
I will ensure that I bookmark your blog and definitely will come back from now on. I want to encourage
continue your great writing, have a nice day!
https://briansclub.be/
I think this is among the most vital information for me.
And i'm glad reading your article. But want to remark on some general things, The
site style is perfect, the articles is really nice : D. Good job, cheers
https://blackpass.at/
Everyone loves what you guys tend to be up too. This type of clever work and exposure!
Keep up the awesome works guys I've you guys to blogroll.
https://bclub.ski
hey there and thank you for your information – I have definitely picked up anything new
from right here. I did however expertise several technical issues using this web site, as I experienced to
reload the website many times previous to I could get it to load
correctly. I had been wondering if your web hosting is OK?
Not that I'm complaining, but slow loading instances times will often affect your placement in google and can damage
your high-quality score if ads and marketing with Adwords.
Well I am adding this RSS to my email and can look
out for much more of your respective exciting content.
Make sure you update this again very soon.
https://vclubshop.plus/
Awesome article.
https://vclub.jp/
Thanks for finally talking about >Assign a different header image per page : :
CMS Made Simple - Tutorials, Tips and Tricks - CMSMS
https://vclubcc.ru/
I got this web site from my pal who told me about this website and now this time I am browsing this web site and reading very informative content at
this time.
https://bclub.vin
Outstanding post but I was wondering if you could write
a litte more on this topic? I'd be very thankful if you
could elaborate a little bit further. Cheers!
https://vclubshop.rs/
Hey very nice blog!! Man .. Beautiful .. Superb .. I'll bookmark your
site and take the feeds also? I am glad to find a lot of useful info right here within the submit, we want develop more strategies in this regard, thank you for
sharing. . . . . .
https://vclub-cc.ru/
bookmarked!!, I really like your web site!
https://briansclubs.kz/
Hello, I want to subscribe for this weblog to take most up-to-date updates, therefore where can i do it
please help out.
https://briansclub.ws/
Oh my goodness! Incredible article dude!
Thank you so much, However I am going through problems with your
RSS. I don't know the reason why I am unable to subscribe to it.
Is there anyone else getting identical RSS issues?
Anybody who knows the answer can you kindly respond?
Thanks!!
https://vclub.bz/
I am extremely inspired together with your writing talents and also with
the structure for your weblog. Is this a paid subject or did you modify it yourself?
Anyway stay up the nice high quality writing, it is uncommon to see a great blog like this one these days..
https://vclub.bz/
My brother suggested I might like this blog.
He was entirely right. This post truly made my day. You can not imagine just how much time I had spent for this info!
Thanks!
https://vclubcc.ru/
Good day! Do you use Twitter? I'd like to follow you if
that would be ok. I'm absolutely enjoying your blog and look forward to new posts.
https://vclub-cc.ru/
Hello to all, how is everything, I think every one is getting more from this website, and your views are nice for new
viewers.
https://vclubshop.rs/
This is really attention-grabbing, You are a very professional blogger.
I have joined your feed and look ahead to in the hunt for extra of your fantastic
post. Additionally, I have shared your site in my
social networks
https://briansclub.ski/
What a stuff of un-ambiguity and preserveness of valuable know-how concerning
unpredicted feelings.
https://briansclub.shop
Hello to every body, it's my first pay a quick
visit of this web site; this web site includes amazing and genuinely good information in favor of visitors.
https://vclubshop.plus/
What's up, yeah this post is actually nice and
I have learned lot of things from it regarding blogging.
thanks.
https://briansclub.ws/
I am really impressed with your writing skills as well as with the layout on your blog.
Is this a paid theme or did you modify it yourself?
Either way keep up the nice quality writing, it is rare to see
a great blog like this one these days.
https://bclub.vin
Wow, marvelous blog layout! How long have you been blogging for?
you made blogging look easy. The overall look of your site is wonderful, let alone the
content!
https://briansclub.vip
Hi! I could have sworn I've visited this blog before but after
going through many of the posts I realized it's new to me.
Nonetheless, I'm certainly pleased I came across it and I'll be book-marking it and checking back frequently!
https://briansclubcc.cm
I think this is one of the most important info for me. And i
am glad reading your article. But should remark on some general things,
The website style is perfect, the articles is really excellent :
D. Good job, cheers
https://briansclub.live
I’m not that much of a online reader to be honest but your sites
really nice, keep it up! I'll go ahead and bookmark your website
to come back in the future. Cheers
https://brainsclub.store
Keep on working, great job!
https://dcshop.ws
Fantastic site. Lots of helpful info here. I am sending it to some friends ans additionally sharing in delicious.
And certainly, thanks for your sweat!
https://briansclubcm.shop
Admiring the dedication you put into your site and in depth information you provide.
It's awesome to come across a blog every once in a while that isn't the same outdated rehashed material.
Great read! I've bookmarked your site and I'm
adding your RSS feeds to my Google account.
https://briansclub.kz/
Wow, this piece of writing is fastidious, my younger
sister is analyzing such things, so I am going to convey her.
https://vclub.jp/
whoah this weblog is magnificent i really like
studying your posts. Stay up the great work! You recognize, many people are hunting
around for this information, you can help them greatly.
https://vclub.jp/
Wow, wonderful blog layout! How lengthy have you
been running a blog for? you made running a blog glance easy.
The whole look of your site is fantastic, let alone the content!
https://vclub-cc.ru/
Excellent post. I definitely appreciate this site.
Continue the good work!
https://dcshop.ws
Hey there! I could have sworn I've been to this website before but after reading through some
of the post I realized it's new to me. Anyhow, I'm definitely glad I
found it and I'll be book-marking and checking back often!
https://vclubshop.rs/
Hi, Neat post. There's an issue together with your web site in web explorer,
may check this? IE still is the market chief and a large component to
folks will leave out your excellent writing due to this problem.
https://bclub.vin
I am really inspired together with your writing abilities as smartly as with the layout in your weblog.
Is this a paid topic or did you customize it yourself?
Anyway keep up the excellent high quality writing, it's rare to look a nice weblog like this one nowadays..
https://vclubcc.ru/
I like the valuable information you provide in your articles.
I will bookmark your weblog and check again here regularly.
I'm quite sure I will learn many new stuff right here!
Best of luck for the next!
https://briansclub.ws/
Hello there, I found your website via Google while searching for a related topic,
your site got here up, it seems good. I've bookmarked it in my google bookmarks.
Hello there, just was alert to your blog through Google, and found that
it is really informative. I am gonna be careful for brussels.
I'll be grateful for those who proceed this in future.
A lot of other folks will likely be benefited out
of your writing. Cheers!
https://briansclubcc.cm
Thanks for sharing your thoughts about cmsms. Regards
https://briansclub.vip
This website was... how do you say it? Relevant!!
Finally I have found something that helped me. Thanks
a lot!
https://briansclubcm.shop
Hi would you mind letting me know which webhost you're utilizing?
I've loaded your blog in 3 different internet browsers and I must say
this blog loads a lot faster then most. Can you suggest a good internet hosting provider at a honest price?
Cheers, I appreciate it!
https://briansclub.live
Greetings from Idaho! I'm bored to tears at work so I decided to check out your site on my iphone during lunch break.
I love the knowledge you present here and can't wait to take a look when I get home.
I'm amazed at how quick your blog loaded on my mobile ..
I'm not even using WIFI, just 3G .. Anyhow, amazing blog!
https://brainsclub.store
Hi there, every time i used to check website posts here in the early hours in the morning,
since i enjoy to find out more and more.
https://briansclub.shop
Hello to all, the contents present at this web site are really remarkable for people knowledge, well, keep up the good work fellows.
https://vclubshop.plus/
Highly descriptive post, I liked that a lot.
Will there be a part 2?
https://briansclub.ski/
There is certainly a lot to find out about this topic.
I like all of the points you've made.
https://briansclub.kz/
No matter if some one searches for his essential thing,
so he/she desires to be available that in detail, so that thing is maintained over
here.
https://vclub.bz/
Wonderful work! That is the kind of info that are meant to be shared
across the web. Disgrace on the search engines for no longer positioning this
submit upper! Come on over and discuss with my web site . Thanks =)
@ Serkan Erturk
Store the images in a folder of the CMSMS Gallery module.
You can assign them as header images for separate pages.
Add the Gallery tag of that folder in a content page and you also have a photo album with all these photo's
I think it is as simple as that.
Very good , there comes a question, think that i have fifteen pages of products and i assign an image for each page, and i want to show them as a grid at the top level of the products automaticlly, how do i achieve it ?
Thanks for your reply, Natalia
Your question is off-topic in this post...
You better ask it in the CMSMS Modules and Add-Ons forumboard:
http://forum.cmsmadesimple.org/viewforum.php?f=7
Thanks a lot for this helpful material! It works just great (I choose the second one).
But I found this tip by the searching on the other question… and there is no any appropriate answer nor at forums or at sites yet...
So, maybe you know the way for adding link to CGBlog's category at the summary and full entries view?... I think it has to be a default option, but It's not...
I tryed all variants that could imagine myself or read on web, but nothing happens... even if I get the link it always blank...
My CMSMS version - 1.11.7