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.
 
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.
 
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.
 
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.webp

0033.webp 0034.webp 0031.webp
 
Try using a conditional.

How can I show content in a specific forum?
<xen:if is="{$forum.node_id} == x">
This content will show in forum x
</xen:if>
Note that in order for this to work, the following line of code must be placed at the top of the forum_view andthread_view templates:
<xen:container var="$forumId">{$forum.node_id}</xen:container>


http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-182355
 
Top Bottom