How to have a different header image in different sub forum?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Darakir
    Senior Member
    • Feb 2010
    • 109

    [Forum] How to have a different header image in different sub forum?

    We have a forum with different games, and we'd like to have the game logo on top of each sub forum of course. I know how to change this per template, but per sub forum seems more difficult. I found this over at vbulletin.org:

    Code:
    <if condition="$foruminfo[forumid] == 16">
    // code for logo 2
    <else />
    // code for logo 1
    </if>
    But I'm just not sure what to substitute the comments for.
    I tried asking over there but have not gotten any reply. Any pointers?
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    If you want to change images, then you would put in image code -
    HTML Code:
    <img src="angry.gif" alt="Angry face" />
    W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment

    • Darakir
      Senior Member
      • Feb 2010
      • 109

      #3
      Originally posted by Lynne
      If you want to change images, then you would put in image code -
      HTML Code:
      <img src="angry.gif" alt="Angry face" />
      http://www.w3schools.com/tags/tag_IMG.asp
      Oh! That was easy... I looked in the header template code and it looked very complicated.
      Thank you!

      Comment

      • Darakir
        Senior Member
        • Feb 2010
        • 109

        #4
        I've added this in the additional css template:

        Code:
        <vb:if condition="$foruminfo[forumid] == 96">
        <img src="victoria_logo_350.jpg" alt="logo" />
        <vb:else />
        <img src="{vb:stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" />
        </vb:if>
        That did nothing, so then I tried to add the same thing in the header template right after class="logo-image">, but nothing happens. I've tried another browser too to rule out cookie issues. What am I doing wrong?

        Comment

        • Trevor Hannant
          vBulletin Support
          • Aug 2002
          • 24326
          • 5.7.X

          #5
          The additional.css template is for CSS only, not your code. You need to add that to the header template
          Vote for:

          - Admin Settable Paid Subscription Reminder Timeframe (vB6)
          - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

          Comment

          • Darakir
            Senior Member
            • Feb 2010
            • 109

            #6
            Solved now. What I actually put in looks a bit different, so I just thought I'd add it here if anyone else wants to do this.
            After class="logo-image"> in the header template, I entered this:
            Code:
            <vb:if condition="((int) $_SERVER['QUERY_STRING']) == 96">
            <img src="images/misc/vbulletin3_logo_white.gif" alt="Image för forum 96" />
            <vb:elseif condition="((int) $_SERVER['QUERY_STRING']) == 323" />
            <img src="images/EU3.jpg" alt="Image för forum 323" />
            <vb:else />
            <img src="{vb : stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" />
            </vb:if>
            Which gives me different headers for two forums, and a third option for all others. This works fine!
            Thanks for all the help!

            Comment

            • DAzz
              New Member
              • Apr 2004
              • 15
              • 3.0.1

              #7
              So, we have this working in our sub-forum. Is there a way to get this to work on the thread view on threads that are posted within the sub-forum?

              Comment

              • thenamesgould
                New Member
                • Apr 2011
                • 12
                • 4.1.x

                #8
                Originally posted by DAzz
                So, we have this working in our sub-forum. Is there a way to get this to work on the thread view on threads that are posted within the sub-forum?
                I'm in the same boat. I've got this working fine (the Newcastle Jets subforum at http://www.marathonstadium.com if anyone is interested) but of course this doesn't work for the threads posted within that sub-forum.

                I'm struggling to think of a way that this mod could be adapted to do that, since threads are only identified by their own ID, not the ID of what forum they are in. Can anyone help with a solution?

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...