Need to style template modules separately? Look here

If any of you have encountered the problem of creating individual styles for each module (I remember seeing this issue in the forum some time back) there's a way to do it.

My scenario was that I wanted to enable different backgrounds for each module area, but as you know when you create a background style in the css all the backgrounds would change, such a pain!

 

BUT there's a way you get your own way by using jquery's parent() class.

 

Dolphin already uses jquery so your class is already there ready to be unleashed, ok so how can it be done.

 

Select a module, I've chosen the video module (you can see the outcome here as you can see the video module has a dark background compared to the rest the modules on the page.

 

Open up /modules/videos/templates/base/browse_unit.html and place this js:

<script>$('div.bx_videos_search_unit').parent().addClass('video_styling');</script>

 

The first div class is the class that this script sits above, the "video_styling" is the class that will be added above "div.bx_videos_search_unit" is will add itself to the div above (the parent, hence the class name).

Don't forget to add your styling into your stylesheet (.video_styling) and add styles to it!

Also flush the cache in the dashboard.

 

Hope this is useful to you guys!

Neil


Template designer | PlayBox Design

Quote · 20 Dec 2011

Thanx

Free the Dolphin...
Quote · 20 Dec 2011

Hi Neil,

How can I get in touch with you? What is your email address?

Thanks,

Alex

Quote · 3 Apr 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.