PDA

View Full Version : Add location dependent css class to markup?


Mokoi
07-15-2012, 12:22 AM
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
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).


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.