1
gruessle
Left block does not disappear when empty.
  • 2003/10/7 5:33

  • gruessle

  • Friend of XOOPS

  • Posts: 348

  • Since: 2003/9/20



If there is nothing in the right block, it will disappear but not the left block.

Is there a fix for that?

Thanx

2
hsalazar
Re: Left block does not disappear when empty.
  • 2003/10/7 6:03

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


gruessle:

This is not a fix, since the persistence of the left block has nothing wrong: it's just the way the theme is done. Assume here we're talking about the default theme; then you'll be able to apply this logic to other themes.

If you open the file theme.html in the theme Default, you'll notice that the TD showing the right column is in the inside of a conditional declaration:

<{if $xoops_showrblock == 1}>

      <
td id="rightcolumn">
        
        <{foreach 
item=block from=$xoops_rblocks}>
          <{include 
file="default/theme_blockright.html"}>
        <{/foreach}>
        
      td>

      <{/if}>

This tells us that this particular TD will show if and only if the variable $xoops_showrblock has a value of 1.

If you look at the TD holding the left column:

<td id="leftcolumn">
        
        <{foreach 
item=block from=$xoops_lblocks}>
          <{include 
file="default/theme_blockleft.html"}>
        <{/foreach}>
        

      td>


... you'll see there's no condition, so the TD appears even if it contains nothing.

How can we change this behavior? We need to enclose this TD in its own conditional, something like:

<{if $xoops_lblocks ""}>
      <
td id="leftcolumn">
        
        <{foreach 
item=block from=$xoops_lblocks}>
          <{include 
file="default/theme_blockleft.html"}>
        <{/foreach}>
        

      td>
      <{/if}>

What we're saying here is: if the array $xoops_lblocks has some content, display the TD.

This should work, at least from the perspective of logic. If it doesn't please tell us in this same thread, in order to further explore the issue.

Cheers.

3
gruessle
Re: Left block does not disappear when empty.
  • 2003/10/7 6:14

  • gruessle

  • Friend of XOOPS

  • Posts: 348

  • Since: 2003/9/20



it is working thank you.
And a special thank you because you are not just helping but also teaching.

4
Anonymous
Re: Left block does not disappear when empty.
  • 2003/10/31 16:22

  • Anonymous

  • Posts: 0

  • Since:


hsalazar -

thanks. this was helpful. i wasn't able to figure out how to if/then the left column. this logic doesn't seem to be included in any of the templates.

- nautis

5
PureLuXus
Re: Left block does not disappear when empty.
  • 2003/10/31 16:25

  • PureLuXus

  • Not too shy to talk

  • Posts: 116

  • Since: 2002/1/3 2


i think the imago themes have a good codebase..
the left block disaper with no problems..

http://www.wild-obsession.de
a heavy modified version *smile*

Login

Who's Online

273 user(s) are online (133 user(s) are browsing Support Forums)


Members: 0


Guests: 273


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