1
uberrookie
show content when there IS content
  • 2011/3/30 11:05

  • uberrookie

  • Just popping in

  • Posts: 34

  • Since: 2011/3/29


I've placed
{$xoops_contents}
inside some divs for styling.

<{if $xoops_contents && ($xoops_contents != ' ') }>
<
div id="content"><{$xoops_contents}>div>
<{/if}>



(The if statement comes from the default 2.5.0 theme)

I don't have a starting page, but my divs are still shown.

In other words....while having no content, the if statement still get executed.

How do i prevent this execution when i have no content?

2
Tarik
Re: show content when there IS content
  • 2011/3/30 12:17

  • Tarik

  • Not too shy to talk

  • Posts: 170

  • Since: 2010/2/3 1


did you use
{$xoops_contents}

or
<{$xoops_contents}>
Some people like what you do,
-- some people hate what you do,
---- but most people simply don’t give a damn.

3
uberrookie
Re: show content when there IS content
  • 2011/3/30 14:13

  • uberrookie

  • Just popping in

  • Posts: 34

  • Since: 2011/3/29


I took a part of the default theme.html:

<{if 
$xoops_contents && ($xoops_contents != ' ') }>
<
div id="content"><{$xoops_contents}>div>
<{/if}>


added a styling div:


<{if 
$xoops_contents && ($xoops_contents != ' ') }>
<
div class="styling">
<
div id="content"><{$xoops_contents}>div>
div>
<{/if}>


The div is always visible

4
uberrookie
Re: show content when there IS content
  • 2011/3/31 13:57

  • uberrookie

  • Just popping in

  • Posts: 34

  • Since: 2011/3/29


apparently the content of $xoops_contents is a 3 chars string. For now i fixed it by using:
<{if $xoops_contents && (strlen($xoops_contents) > 3) }>

but i don't think its a solution.

Login

Who's Online

257 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 257


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