1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom page background for different nodes without new style?

Discussion in 'XenForo Pre-Sales Questions' started by J3rry, Aug 9, 2011.

  1. J3rry

    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.
     
  2. Brogan

    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.
     
  3. J3rry

    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?
     
  4. dieketzer

    dieketzer Well-Known Member

    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.
     
  5. dieketzer

    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
     
  6. J3rry

    J3rry Member

    dieketzer, thank you very much for detailed explanation! Gona test it now.
     
  7. maidos

    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
     
  8. ragtek

    ragtek Guest

    false thread?
     
  9. maidos

    maidos Active Member

    no personal converstion with kier. Why does it have to be fake if i tell it is from kier? he can confirm it himself

     
  10. ragtek

    ragtek Guest

    no, i mean "what does the downloads add-on" have to do with the "custom background thread" here;)
     
  11. maidos

    maidos Active Member

    then i suggest you read the ops thread properly
     
  12. vkams

    vkams Active Member

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

    Brogan XenForo Moderator Staff Member

    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
     

Share This Page