6
Re:
I want to add a new block in xoopscore blocks.
Quote:
I am trying to add a new block type as side block left bottom.
...some blocks at the bottom have to have a different layout and style
There is no need to add a new XOOPS core block to change the style for some blocks. The core developers have provided the smarty variable $block.weight and we can use it to identify blocks for special treatment.
To change the style for blocks at the bottom of a XOOPS Left Block using <{$block.weight}>:Add a conditional and some math <{if $block.weight <
n}> to set a threshold where the blocks should change style and add it to your theme_blockleft.html template.
Go to system blocks admin and set the block's weight greater than
n to highlight.
You can also highlight a specific block by giving the block a unique weight
n and using <{if $block.weight =
n}>.
You can highlight a group of blocks by setting their Order Weight equal to
n and using <{if $block.weight =
n}>.
For example, at
Technical Crew Network this <{$block.weight < 50}> was added to theme_blockleft.html to give blocks with a weight above 50 a yellow background.
In theme_blockleft.html:
<{if $block.weight < 50}>
<{if $block.title}>
<div class="blockTitle">
<h3><{$block.title}>h3>
div>
<{/if}>
<div class="blockContent">
<{$block.content}>
div>
<{else}>
<div class="leftcolumnbottom" style="background-color: #FFFFCC">
<{if $block.title}>
<div class="blockTitle">
<h3><{$block.title}>h3>
div>
<{/if}>
<div class="blockContent">
<{$block.content}>
div>
div>
<{/if}>
You will probably want to add the class leftcolumnbottom to your style sheet instead of using the example's inline style.
You could use this in your theme.html but it would require a new theme_blockleftbottom.html template.