Re: Code for hiding block titles

Posted by Will on 1203622795
Well, if you do not plan on changing it to much there is a way to set it using only the cycle values.

IE.

<div class="<{cycle values="blockTitle,blockTitle2,blockTitle3,blockTitle,blockTitle,blockTitle"}>"><{$block.title}></div> <div class="blockContent"><{$block.content}></div>


Basically what this will do is cycle the css class. So you can style them based on where they are.

css example
#leftcolumn { width: 220px; font-size: 12px; padding-top: 5px; padding-left: 5px; padding-right: 5px; } #leftcolumn div.blockTitle { color: #FFF; text-align:left; font-weight: bold; font-size: 12px; } #leftcolumn div.blockTitle2 { display: none; } #leftcolumn div.blockTitle3 { color: #000; text-align:left; font-weight: bold; font-size: 12px; background-image: url(images/blah.jpg) no-repeat; } #leftcolumn div.blockContent { color: #FFF; padding: 4px; background-color: #000; }


Only issue with doing it this way is that each tome you add a block to that column you will need to add a new cycle value to account for it. Which like I said wouldn't be that big of a deal if you weren't planning on changing it that often.

This Post was from: https://www.impresscms.org/iforum/viewtopic.php?topic_id=1079&post_id=10013