Custom page background for different nodes without new style?

J3rry

Member
Hi there!

Is it possible to add custom page background for different forums/categories without applying new style? I'm able to do that with vbulletin template scripting, but what about xenforo?

And will there be converter for Resource Manager from DownloadsII (vbulletin addon)?

Thanks.
 

Brogan

XenForo moderator
Staff member
You can force forums to use specific styles, which will achieve what you want.

The Resource Manager hasn't even yet been deployed here on XenForo.com, never mind made available to customers, so it's a bit premature to be discussing whether converters for add-ons from vB will be catered for.
 

J3rry

Member
Thank you for your reply. But if I don't want to create too many styles is it possible to apply background with template scripting. Is there any condition for node number?
 

dieketzer

Well-known member
Thank you for your reply. But if I don't want to create too many styles is it possible to apply background with template scripting. Is there any condition for node number?
yes. you can do this.
i do something similar, where a different image is called below the editor depending upon which subforum one is in.
 

dieketzer

Well-known member
more info you can use.
start a xf demo and try to achieve this yourself if you wish:

open the quick_reply and thread_reply templates and add this:
Code:
    <xen:include template="nsfw" />
create a new template called nsfw. i do this so that i can add/change forum rules from a single template.
using an array i can dictate which css style is applied in each forum.
add this to the template:
Code:
<xen:if is="in_array({$forum.node_id}, array(2,9,10,14,15,16))">
<div class="nsfw_sfw">
</div>
</xen:if>
<xen:if is="in_array({$forum.node_id}, array(12))">
<div class="nsfw_nsfw01">
</div>
</xen:if>
<xen:if is="in_array({$forum.node_id}, array(13,17))">
<div class="nsfw_nsfw02">
</div>
</xen:if>
<xen:if is="in_array({$forum.node_id}, array(4,5,7))">
<div class="nsfw_admin">
</div>
</xen:if>
in EXTRA.css template (its for any custom css additions/overrides) add the css:
Code:
/* NSFW warnings */
.nsfw_sfw {
background: url('@imagePath/xenforo/nsfw/sfw.png');
display: block;
height: 12px;
width: 100%;
margin: 5px 0px 0px 0px;
}
.nsfw_nsfw01 {
background: url('@imagePath/xenforo/nsfw/nsfw01.png');
display: block;
height: 12px;
width: 100%;
margin: 5px 0px 0px 0px;
}
.nsfw_nsfw02 {
background: url('@imagePath/xenforo/nsfw/nsfw02.png');
display: block;
height: 12px;
width: 100%;
margin: 5px 0px 0px 0px;
}
.nsfw_admin {
background: url('@imagePath/xenforo/nsfw/admin.png');
display: block;
height: 12px;
width: 100%;
margin: 5px 0px 0px 0px;
}
the result is that i can have a different div background depending upon the node. it helps to remind members which subforum they are in and the behaviour that is expected there.

0032.png

0033.png 0034.png 0031.png
 

maidos

Active member
well i asked kier but he said they dont have any plans to include the conversion script for downloadsII. He said they would consider if the demand is high
 

vkams

Active member
I'd like to set up different headers for different forums without multiple similar styles. How is it possible?
 
Top