1
frankblack
Does a block or block-template know where it is positioned?
  • 2008/7/29 16:37

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Strange question, I know! I would like to use a css-only based tooltip, but therefore I need to know whether the block is placed on the left or right side. If I know this, then I can use different classes for the tooltip. A smarty-solution would be nice.

Any hints for me?

2
Burning
Re: Does a block or block-template know where it is positioned?
  • 2008/7/29 17:50

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi,

You might take a look to "Morphogenesis gabarit" and his stylesheet blocks.css.

Many combinations :
#xo-page-topleftblocks .xo-block {}
#xo-page-bottomleftblocks .xo-block {}
#xo-page-toprightblocks .xo-block {}
#xo-page-bottomrightblocks .xo-block {}
... etc.

Hope it helps

@+
Still learning CSS and... english

3
demian
Re: Does a block or block-template know where it is positioned?
  • 2008/7/29 17:58

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


in the default theme there arte $xoops_showcblock,$xoops_showlblock,$xoops_showrblock,

maybe
<{if $xoops_showcblock }>

style1.css


<{elseif $xoops_showrblock}>

style2.css

<{else}>

style3.css


didn't try it

4
scrapple
Re: Does a block or block-template know where it is positioned?
  • 2008/7/29 21:13

  • scrapple

  • Just popping in

  • Posts: 1

  • Since: 2008/7/29


doesn't seem to be any theme guys left here at XOOPS to help you... maybe ask somewhere else?

5
abrizan
Re: Does a block or block-template know where it is positioned?
  • 2009/12/16 13:40

  • abrizan

  • Just popping in

  • Posts: 82

  • Since: 2005/11/14


Bump.
I have this same issue. I need my main menu block to output different html if it is left or right.

I even tried putting
<{assign var="Block_Position" value="canvas_left"}>
before the
<{foreach item=block from=$xoBlocks.canvas_left}>....
and
<{assign var="Block_Position" value="canvas_right"}>
befpre the
<{foreach item=block from=$xoBlocks.canvas_right}>.....
but no luck.

The main template "sees" <{$Block_Position}> but the block doesn't.

Is there any way to do this without a core hack?

6
ghia
Re: Does a block or block-template know where it is positioned?
  • 2009/12/16 13:59

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


You make the left and right html in your block inside a div with class eg leftpart and rightpart.
Your columns have also a class, name or id in their div eg class leftcolumn.
In your CSS you suppress the inappropriate parts:
.leftcolumn .rightpart {displaynone};
.
rightcolumn .leftpart {displaynone};


7
trabis
Re: Does a block or block-template know where it is positioned?
  • 2009/12/16 14:18

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I think you need to hack core or wait for a better version.


8
abrizan
Re: Does a block or block-template know where it is positioned?
  • 2009/12/16 17:08

  • abrizan

  • Just popping in

  • Posts: 82

  • Since: 2005/11/14


I was hoping to find a more elegant Smarty solution and not a CSS or Javascript hack.
Is there really no way that this can achieved through Smarty?

9
trabis
Re: Does a block or block-template know where it is positioned?
  • 2009/12/16 19:10

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


No smarty solution because blocks are rendered first and then they are assigned to positions so, at block execution time, smarty is not aware of the block location. This requires only line of code in class theme_blocks.php, maybe in next release.

10
abrizan
Re: Does a block or block-template know where it is positioned?
  • 2009/12/16 19:44

  • abrizan

  • Just popping in

  • Posts: 82

  • Since: 2005/11/14


I would greatly appreciate it if this could be included in the next release. It would be very useful in my theme development.

Login

Who's Online

388 user(s) are online (259 user(s) are browsing Support Forums)


Members: 0


Guests: 388


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits