Change automatically header's images

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
User avatar
Canoran
Registered User
Posts: 76
Joined: Thu May 17, 2018 3:56 pm

Change automatically header's images

Post by Canoran » Sat Jun 09, 2018 1:03 pm

Hi,
I would like to know if I can display different images in the header according to the different forums that is being consulted.

Are there some extension can halp me to do this?

Thank you for your help.

User avatar
pit-PL
Registered User
Posts: 3070
Joined: Sat Nov 21, 2009 12:24 pm

Re: Change automatically header's images

Post by pit-PL » Tue Jun 12, 2018 7:33 pm

You can use the forum ID to add an extra CSS class next to class that makes the header blue,

Code: Select all

<div class="headerbar<!-- IF FORUM_ID == 2 --> headerbar-forum2<!-- ELSEIF FORUM_ID == 5 --> headerbar-forum5<!-- ENDIF -->" role="banner">
and then your CSS would look like this:

Code: Select all

.headerbar-forum2 {
	background: green;
}

.headerbar-forum5 {
	background: red;
}
The ID is the bit on the end of the URL, which looks like &f=2.

User avatar
eeji
Jr. Style Validator
Posts: 943
Joined: Fri Dec 12, 2008 9:08 pm
Location: Manchester, UK
Contact:

Re: Change automatically header's images

Post by eeji » Tue Jun 12, 2018 10:00 pm

To simplify the above and negate the need to alter the html every time a new forum is added you could use:

Code: Select all

<div class="headerbar-forum<!-- FORUM_ID -->" role="banner">
The CSS would remain as above.
Last edited by eeji on Wed Jun 13, 2018 7:22 pm, edited 1 time in total.

User avatar
Canoran
Registered User
Posts: 76
Joined: Thu May 17, 2018 3:56 pm

Re: Change automatically header's images

Post by Canoran » Tue Jun 12, 2018 10:53 pm

Thank you for your suggestion.

I'm not a developer, at this stage I would prefer an extension, if it's available of course.

Post Reply

Return to “[3.2.x] Styles Support & Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests