1
studioC
how to get <{$xoops_showlblock}> ??
  • 2004/3/19 20:11

  • studioC

  • Friend of XOOPS

  • Posts: 922

  • Since: 2003/12/7


to let the theme.html ask if leftblock is activated ?
there is info about ..

<{if $xoops_showcblock == 1}>
<{if $xoops_showrblock == 1}>

but huu.. why not for this ? ..
<{if $xoops_showlblock == 1}>
it would be a extra factor to get info about themeusage and to modify themedisplay....

any ideas ?


greetings
michael



2
studioC
no possibility to get this ?
  • 2004/3/20 9:23

  • studioC

  • Friend of XOOPS

  • Posts: 922

  • Since: 2003/12/7


..hm ..
i want to display a twocolumn-layout if leftblock is not in use and otherwise a threecolumn-layout ...
any ideas to get this without this thinking around corners ?

michael

3
Mithrandir
Re: no possibility to get this ?

You would either have to hack into the header.php to assign a value to $xoopsshowlblock, which you can then use in your theme - or have the theme find out if there are elements in the $xoopslblocks array.
<{php}>
if (isset(
$xoopslblocks) && (count($xoopslblocks)>0) {
<{/
php}>
    <{
assign var="xoopsshowlblock" value="1"}>
<{
php}>
}
else {
<{/
php}>
    <{
assign var="xoopsshowlblock" value="0"}>
<{
php}>
}
<{/
php}>

I have not tested the snippet above and the best thing would be to
a) have a count elements in array function in Smarty, so we don't have to use <{php}>
b) assigning the variable from within the <{php}> so we don't have to have multiple <{php}> tags

It should be possible to do b) but I cannot remember how.

4
DonXoop
Re: how to get <{$xoops_showlblock}> ??

I had wondered that myself. I found this to work:

<{if $xoops_lblocks}>

No hacks, it just works. good luck.

5
studioC
Re: how to get <{$xoops_showlblock}> ??
  • 2004/3/20 11:54

  • studioC

  • Friend of XOOPS

  • Posts: 922

  • Since: 2003/12/7


huuh.. most amazing things are easy.. !

i will try this .. it would be easier for me to use this... i actually found <{$xoops_lblocks}> giving back "Array" as text if leftblocks found, empty cell if none, and i am able to place ids or classes within "<{$xoops_lblocks}>name" but in that way i have i cant place an "if" ...
using different html and css if found or not...

thanks for sharing ideas DonXoop and Mithrandir
michael

6
DonXoop
Re: how to get <{$xoops_showlblock}> ??

I use it in my theme.html. My album module is center block + right block with no left blocks.

I simply do:

<{if $xoops_lblocks}>
<td rowspan="2" id="leftcolumn" valign="top">
<!-- Start left blocks loop -->
<{foreach item=block from=$xoops_lblocks}>
<{include file="my_theme/theme_blockleft.html"}>
<{/foreach}>
<!-- End left blocks loop -->
</td>
<{/if}>

7
sudhaker
Re: how to get <{$xoops_showlblock}> ??
  • 2005/1/20 17:03

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


Does this mean, $xoops_showrblock is also redundant?

<{if $xoops_rblocks}>
<
td rowspan="2" id="rightcolumn" valign="top">
<!-- 
Start right blocks loop -->
<{foreach 
item=block from=$xoops_rblocks}>
<{include 
file="my_theme/theme_blockright.html"}>
<{/foreach}>
<!-- 
End right blocks loop -->
</
td>
<{/if}>


Which one will be better? Conventional or this one?

8
Mithrandir
Re: how to get ??

the <{$xoops_showrblocks}> might be a leftover from earlier Smarty versions. I don't know as I am not aware of all the changes in the various Smarty versions.

With XOOPS 2.0.7 or later, I would say that it is indeed redundant as <{if $xoops_rblocks}> will be true, if the variable $xoops_rblocks exists - however, I cannot say whether it will be false, if it is an empty array.

9
nettcom
Re: how to get <{$xoops_showlblock}> ??
  • 2008/10/3 15:21

  • nettcom

  • Just popping in

  • Posts: 8

  • Since: 2002/11/14


Use my hack fo this...
edit file theme.html, before the line:
<{if $xoops_showlblock == 1}>
add this code:
<{php}> 
    
$mod $GLOBALS['xoopsModule']; 
    
$dirname = (isset($mod) ? $mod->getVar('dirname') :'system'); 
    if (
$dirname == 'your_module_dir_name')
    {
     
$GLOBALS['xoopsTpl']->assign'xoops_showlblock'); 
    }
<{/
php}>


regards!

Login

Who's Online

221 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 221


more...

Donat-O-Meter

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

Latest GitHub Commits