vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Forum Home Enhancements - Change Background Color for Specific Forums on Homepage (https://vborg.vbsupport.ru/showthread.php?t=293417)

addamroy 12-29-2012 11:00 PM

Change Background Color for Specific Forums on Homepage
 
1 Attachment(s)
This modification will allow you to change the background color of specific forums on your forumhome.

For example, if you want to draw more attention to your private sections to drive paid registrations, this can help.

This mod is done via one simple template edit.

STEP 1 - Find the forumhome_forumbit_level2_post template via edit templates > Forum Home Templates.

Find the code below
Code:

<div class="forumrow table">
And replace it with
Code:

<div class="forumrow table"
<vb:if condition="$forum[forumid] == XXX">
style="background-color:#xxxxxx;"
</vb:if>
>

Replace XXX with the forumid of the forum you want to change the background color of.

Replace xxxxxx to the hex code of the color you want to use. You can find hex codes here, http://www.html-color-codes.com

If you have multiple forums you want to change the background colors of for each, simply stack additional vb:if conditions before the > for each forum you want to change.

Like below
Code:

<div class="forumrow table"
<vb:if condition="$forum[forumid] == XXX">
style="background-color:#xxxxxx;"
</vb:if>
<vb:if condition="$forum[forumid] == XXX">
style="background-color:#xxxxxx;"
</vb:if>
<vb:if condition="$forum[forumid] == XXX">
style="background-color:#xxxxxx;"
</vb:if>
>

Straight forward, works like a charm.

Check out my other Template Modifications for 4.x!

[Postbit-Legacy Hack] Attractive User Info Boxes for Posts

Link Private Forums to thread instead of error message

Sidebar Anywhere Enhancement - Custom Blocks Per Forum or Page

Change Thread Title Color for Specific Forums on Homepage

Change Title Color of Specific Forums on Homepage

Thread Starter Image in Postbit for OP

CUSTOM BUTTONS that look like your forum!

Custom User Rank Box in Posts

astdirect 03-26-2013 02:49 PM

Didn't work for me im afraid - no change.

masonox 05-19-2013 01:29 PM

Best I've been able to do with only a minute of work is change it to this to change text color. I haven't tried working with background colors, but I'm sure the html is simple.

<vb:if condition="$forum[forumid] == XXX">
<span style="color:XXXX">
</vb:if>

faisaly.com 06-01-2013 04:25 PM

does not work using vb4.1.11 just added the simple code....

edytwinky 06-13-2013 07:17 PM

Is this working for anybody?

addamroy 06-18-2013 11:13 AM

I re worked the code a little bit, try again.

Raptor 10-24-2017 08:20 PM

not working in vb 4.2.3

ShawneyJ 10-25-2017 06:17 AM

1 Attachment(s)
Works ok on my test board Version 4.2.5.

Raptor 11-19-2019 03:28 AM

this worked perfectly - simply add to the themes additional.css

XXX is the forum ID, #FFFFFF is the color

#catXXX .forumhead {
background: #FFFFFF !important;
}

Thanks to MarkL

Raptor 11-19-2019 10:26 AM

Add this code to additional.css and it will change the background color of the header, the topic title, and the topic description

Simply add the forum ID and colors :)

Example:
Code:

#cat374 .forumhead {
        background: #2491BF !important;
}
#cat374 .forumbit_post .forumtitle a {
    color: #2491BF !important;
}
#cat374 .forumbit_post .forumdescription {
    color: #373737 !important;
}

Tested with vb4.2.5


All times are GMT. The time now is 06:13 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01078 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete