xoops forums

kerkyra

Just can't stay away
Posted on: 2011/9/9 12:18
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#1

HOW-TO: Have different styles for each block individually and control title visibility through css

I recently found an easy way to control how my blocks show individually.

here it is....

Quote:

<div class="rightblock" align="right">
<div class="blockTitle block<{$block.id}>" ><{$block.title}></div>
<div class="blockContent content<{$block.id}>"><{$block.content}></div>
</div>


Every block has an id once saved, so in my rightblocks.html template, I add a class to my title div and one class to my content div (could also be an id instead of a second class, whatever suites you)

In the example above the title has the block<{$block.id}> class
and the content area has the content<{$block.id}> class

So now if we examine the webpage's html we can see the actual class names of every block, and write the css for each one of them individually. :) while maintaining the basic characteristics of the primary classes.

I hope it helps someone.

novlang1984

Not too shy to talk
Posted on: 2011/9/9 12:38
novlang1984
novlang1984 (Show more)
Not too shy to talk
Posts: 135
Since: 2010/11/5
#2

Re: HOW-TO: Have different styles for each block individually and control title visibility through css

Thanks :)

For those who want more, take a look to Morphogenesis theme and especially blocks tpl
Quote:
<div id="xo-block-<{$block.module}>-<{$block.id}>" class="xo-block <{$block.module}>">

nb : "<{$block.module}>-" is not very useful in my opinion