Mazar Mazar
  • Not too shy to talk
  • Not too shy to talk
  • Joined: 2009/1/3 19:27
  • Group: Registered Users Designer Group
  • Posts: 191
  • Posted on: 2009/7/21 6:46
I want to add a new block in xoopscore blocks #1
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 trabis
  • Core Developer
  • Core Developer
  • Joined: 2006/9/1 14:10
  • From Portugal
  • Group: Webmaster Registered Users
  • Posts: 2253
  • Posted on: 2009/7/21 8:58
Re: I want to add a new block in xoopscore blocks #2
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 tcnet
  • Friend of XOOPS
  • Friend of XOOPS
  • Joined: 2006/5/11 20:13
  • From Holopaw Beach
  • Group: Registered Users
  • Posts: 297
  • Posted on: 2009/7/21 10:41
Re: I want to add a new block in xoopscore blocks #3
Are you using all of the center blocks? You could move an unused center block to the bottom left column of your theme.
Mazar Mazar
  • Not too shy to talk
  • Not too shy to talk
  • Joined: 2009/1/3 19:27
  • Group: Registered Users Designer Group
  • Posts: 191
  • Posted on: 2009/7/21 10:46
Re: I want to add a new block in xoopscore blocks #4
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 Mazar
  • Not too shy to talk
  • Not too shy to talk
  • Joined: 2009/1/3 19:27
  • Group: Registered Users Designer Group
  • Posts: 191
  • Posted on: 2009/7/21 10:49
Re: I want to add a new block in xoopscore blocks #5
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 tcnet
  • Friend of XOOPS
  • Friend of XOOPS
  • Joined: 2006/5/11 20:13
  • From Holopaw Beach
  • Group: Registered Users
  • Posts: 297
  • Posted on: 2009/7/23 12:58
How to Change Style for Blocks Inside a XOOPS Core Block #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}>
  <!-- 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.
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team