(1) 2 »
frankblack frankblack
  • Just can't stay away
  • Just can't stay away
  • Joined: 2005/6/13 4:03
  • From D-Schiefbahn
  • Group: Registered Users
  • Posts: 830
  • Posted on: 2008/7/29 12:37
Does a block or block-template know where it is positioned? #1
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?
Burning Burning
  • Theme Designer
  • Theme Designer
  • Joined: 2006/8/22 15:44
  • Group: Registered Users Repository Group
  • Posts: 1163
  • Posted on: 2008/7/29 13:50
Re: Does a block or block-template know where it is positioned? #2
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
demian demian
  • Quite a regular
  • Quite a regular
  • Joined: 2008/4/29 1:06
  • Group: Registered Users
  • Posts: 225
  • Posted on: 2008/7/29 13:58
Re: Does a block or block-template know where it is positioned? #3
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
scrapple scrapple
  • Just popping in
  • Just popping in
  • Joined: 2008/7/29 17:12
  • Group: Registered Users
  • Posts: 1
  • Posted on: 2008/7/29 17:13
Re: Does a block or block-template know where it is positioned? #4
doesn't seem to be any theme guys left here at XOOPS to help you... maybe ask somewhere else?
abrizan abrizan
  • Just popping in
  • Just popping in
  • Joined: 2005/11/14 8:16
  • From Trinidad (Caribbean)
  • Group: Registered Users
  • Posts: 82
  • Posted on: 2009/12/16 8:40
Re: Does a block or block-template know where it is positioned? #5
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?
ghia ghia
  • Community Support Member
  • Community Support Member
  • Joined: 2008/7/3 15:19
  • From Belgium
  • Group: Registered Users
  • Posts: 4946
  • Posted on: 2009/12/16 8:59
Re: Does a block or block-template know where it is positioned? #6
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};

trabis trabis
  • Core Developer
  • Core Developer
  • Joined: 2006/9/1 14:10
  • From Portugal
  • Group: Webmaster Registered Users
  • Posts: 2253
  • Posted on: 2009/12/16 9:18
Re: Does a block or block-template know where it is positioned? #7
I think you need to hack core or wait for a better version.

abrizan abrizan
  • Just popping in
  • Just popping in
  • Joined: 2005/11/14 8:16
  • From Trinidad (Caribbean)
  • Group: Registered Users
  • Posts: 82
  • Posted on: 2009/12/16 12:08
Re: Does a block or block-template know where it is positioned? #8
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?
trabis trabis
  • Core Developer
  • Core Developer
  • Joined: 2006/9/1 14:10
  • From Portugal
  • Group: Webmaster Registered Users
  • Posts: 2253
  • Posted on: 2009/12/16 14:10
Re: Does a block or block-template know where it is positioned? #9
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.
abrizan abrizan
  • Just popping in
  • Just popping in
  • Joined: 2005/11/14 8:16
  • From Trinidad (Caribbean)
  • Group: Registered Users
  • Posts: 82
  • Posted on: 2009/12/16 14:44
Re: Does a block or block-template know where it is positioned? #10
I would greatly appreciate it if this could be included in the next release. It would be very useful in my theme development.
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team