1
Mazar
I want to add a new block in xoopscore blocks
  • 2009/7/21 10:46

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


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

2
trabis
Re: I want to add a new block in xoopscore blocks
  • 2009/7/21 12:58

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


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.

3
tcnet
Re: I want to add a new block in xoopscore blocks
  • 2009/7/21 14:41

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


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

4
Mazar
Re: I want to add a new block in xoopscore blocks
  • 2009/7/21 14:46

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


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.

5
Mazar
Re: I want to add a new block in xoopscore blocks
  • 2009/7/21 14:49

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


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 ;)

6
tcnet
How to Change Style for Blocks Inside a XOOPS Core Block
  • 2009/7/23 16:58

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


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.

Login

Who's Online

154 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 154


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