Xuups
Get an account!     Login

Utilities

Main menu

Who's Online

9 user(s) are online (1 user(s) are browsing Hacks and Tips)

Members: 0
Guests: 9

more...

Get Xoops

Support Xuups Project

Themes :  Preventing empty blocks to display
Tags: hack   themes   blocks  
 
It is normal that an empty block still displays in your theme.html, this is not a block problem but a theme problem.

It can be very annoying when your blocks are surronded by lines or have images appended to them.

There are some ways to prevent this. I´ll give you an example for the left blocks:

Normal way (if there is an empty block it displays it):
<{foreach item=block from=$xoops_lblocks}>
      <
div class="blockTitle"><{$block.title}></div>
      <
div class="blockContent"><{$block.content}></div>
<{/foreach}>


My way:
<{foreach item=block from=$xoops_lblocks}>
      <{if 
$block.title && $block.content}><div class="blockTitle"><{$block.title}></div><{/if}>
      <{if 
$block.content}><div class="blockContent"><{$block.content}></div><{/if}>
<{/foreach}>


As you can see, in 'my way' it works like this:
Block has title and content: shows title and content.
Block has no title but has content: Shows only the content.
Block has no content: Do not display title nor content.

If you are using a morphogenesis theme then you must change 2 files:

themes/your_theme/tpl/blocksone.html
themes/your_theme/tpl/centerblocks.html

In both this files search for:
<{if $block.title}><div class="xo-blocktitle"><{$block.title}></div><{/if}>
        <
div class="xo-blockcontent"><{$block.content}></div>


And replace by:
<{if $block.title && $block.content}><div class="xo-blocktitle"><{$block.title}></div><{/if}>
        <{if 
$block.content}><div class="xo-blockcontent"><{$block.content}></div><{/if}>


Enjoy!


TDM

Author
trabis
Author trabis
News by the same authorMore stories
Author rssAuthor rss
StatisticsStatistics
 
Story
Date 2008/8/2 20:18:03
Views 3030
Favorites 0
Send this Story to a FriendSend
Printer Friendly PagePrint
Create a PDF from the articleCreate a pdf
 
Bookmarks
         
         
         
         
         
     
Recents
How to sucessfuly add scripts in your Xoops Themes
Query timers on debug for xoops 2.3
Highlighting current module on mainMenu
Main menu hack - on click submenus
Preventing empty blocks to display
Random
How to sucessfuly add scripts in your Xoops Themes
Query timers on debug for xoops 2.3
Preventing empty blocks to display
Adding an horizontal multiMenu to Xoops
Hacking Multimenu - Selected menus
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread
 

Login

Username:

Password:

Remember me



Lost Password?

Register now!

Ajax Search


Advanced Search

Sub menu

Last comments