Categories > TinyButStrong general >

Hiding blocks of HTML

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Indrid Cold
Date: 2006-11-25
Time: 20:11

Hiding blocks of HTML

Hi,

Basically what I want to do is hide a section of html like this:

<div>
... stuff inside here
</div>

I don't want that div to show up at all unless the person is logged in. I know in smarty all I would have to do is say:

{if $login}
<div>
... stuff inside here
</div>
{/if}

but I don't understand how this is done in TBS.
By: Skrol29
Date: 2006-11-25
Time: 21:22

Re: Hiding blocks of HTML

Hi,

There are examples in line about conditional display at the Examples page.
In your case, assuming that $login can be true or false, it can be something like:
<div>
[onload;block=div;when [var.login]!='']
... stuff inside here
</div>

By: Indrid Cold
Date: 2006-11-25
Time: 21:42

Re: Hiding blocks of HTML

Thanks for the reply! Yes I saw the examples in the manual, however none of them show how to hide the entire div. As in your example (if I am not mistaken) the syntax only hides the contents of the div, not the whole thing ?
By: Indrid Cold
Date: 2006-11-25
Time: 21:43

Re: Hiding blocks of HTML

Ah! I take it back. I understand now! that's fantastic - thank you!