vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Add location dependent css class to markup? (https://vborg.vbsupport.ru/showthread.php?t=285558)

Mokoi 07-15-2012 12:22 AM

Add location dependent css class to markup?
 
I'm looking into ways to theme different sections of the site with a unique style. Coming from other CM systems, I am used to be able to reference classes that are added to markup for this purpose.

Example: when browing the blog of user 1234, the body tag might read something like <body class="blog blog-1234">.

I've not been able to find an answer to this, as it is difficult to STFW on vbulletin topics (too much noise due to the copyright footer all over the web). Maybe someone arround here has had the same issue / know of a solution?

Lynne 07-15-2012 03:44 AM

Add your own class to the template?

Are you looking to theme it based on userid? Or based on page? Or based on????? We need a bit more info (like links) in order to really help. But, entering your own class is always an option.

Mokoi 07-19-2012 06:14 PM

Quote:

Originally Posted by Lynne (Post 2348207)
Add your own class to the template?

That would be static, I need a class to have its value derived from other variables of the page being shown (e.g. the blog-id currently being viewed).

Quote:

Originally Posted by Lynne (Post 2348207)
Are you looking to theme it based on userid? Or based on page? Or based on????? We need a bit more info (like links) in order to really help. But, entering your own class is always an option.

I'll try to give a specific example:

We have a userblog that should be displayed using different css than all other blogs. Ideally I'd be able to generate something like <body class="blog-%userid%"> to override general blog styles with specific style instructions for specific blogs on the vb4 site.

Lynne 07-19-2012 09:09 PM

Then modify to have a class like that (the userid variables depends on the template you are adding it to, so I can't tell you what that variable is supposed to be) and then add the css to your addiitonal.css template or the <head> of that template.


All times are GMT. The time now is 07:57 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.00936 seconds
  • Memory Usage 1,717KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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