1
kerkyra
HOW-TO: Have different styles for each block individually and control title visibility through css
  • 2011/9/9 12:18

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


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.

2
novlang1984
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

Login

Who's Online

207 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 207


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits