xoops forums

Mazar

Not too shy to talk
Posted on: 2009/7/21 6:46
Mazar
Mazar (Show more)
Not too shy to talk
Posts: 191
Since: 2009/1/3 1
#1

I want to add a new block in xoopscore blocks

I am trying to add a new block type as side block left bottom.
i added it in admin system section. but i cannot find and figuoure out where i can define it for theme something like
sideleftbottom.html. anyone here to help me?
Resized Image

This is what i am trying to do see the above image. Need help doing it for client he wants some blocks at the bottom have to have a different layout and style

trabis

Core Developer
Posted on: 2009/7/21 8:58
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#2

Re: I want to add a new block in xoopscore blocks

Can't you apply a css style depending on the block name?
Like :

<{if $block.title == 'mytitle' || $block.title == 'myothertitle'}>
class='myclassname'
<{/if}>

There are other ways. You can prefix your block name with class_ and the use some smarty function to see if title is prefixed, remove the prefix, and apply the class. I have seen it some done somewhere but don't know how to do it by head.

I think hacking the core is not a good idea and it is a big task. I'm not sure you will get free help for that.

tcnet

Friend of XOOPS
Posted on: 2009/7/21 10:41
tcnet
tcnet (Show more)
Friend of XOOPS
Posts: 297
Since: 2006/5/11
#3

Re: I want to add a new block in xoopscore blocks

Are you using all of the center blocks? You could move an unused center block to the bottom left column of your theme.

Mazar

Not too shy to talk
Posted on: 2009/7/21 10:46
Mazar
Mazar (Show more)
Not too shy to talk
Posts: 191
Since: 2009/1/3 1
#4

Re: I want to add a new block in xoopscore blocks

I did move center bottom left block but now the client needs that block for something else.
so i decided to add a new block type.but it seems not working properly.

Mazar

Not too shy to talk
Posted on: 2009/7/21 10:49
Mazar
Mazar (Show more)
Not too shy to talk
Posts: 191
Since: 2009/1/3 1
#5

Re: I want to add a new block in xoopscore blocks

I think XOOPS developer team should really consider adding some more block type into the system
left block,
left middle block,
left bottom, block.

and same for center blocks and right blocks.

It would be good i think.
or maybe i am in need ;)

tcnet

Friend of XOOPS
Posted on: 2009/7/23 12:58
tcnet
tcnet (Show more)
Friend of XOOPS
Posts: 297
Since: 2006/5/11
#6

How to Change Style for Blocks Inside a XOOPS Core Block

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}>
  <!-- default 
style -->
  <{if 
$block.title}>
    <
div class="blockTitle">
      <
h3><{$block.title}></h3>
    </
div>
   <{/if}>
   <
div class="blockContent">
     <{
$block.content}>
   </
div>
<{else}>
  <!-- 
special style -->
  <
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.