Those Sidebars are nice, but sometimes you just don't wan't to see them all, so we would like to make them small. This is no problem with JavaScript.


<a class='flip' href="javascript:toggle('bsagBoxCook');">

does this.
The Problem
The problem arises when you open a new Page. The Box doesn't remember it's state, because the javascript doesn't get called. which may be really nasty with big boxes like my Bsag Module. So we need to inform the HTML Code wether it shall be opend or closed when we load the page.
We include into the Module that the Cookie (which is brought in some magical way into php :-) Data is assigned to a smarty Variabel.



Inside our .tpl we can now reference this Value.

<div class="box">
<div class="box-title"><a  class='flip' href="javascript:toggle('bsagBoxCook');">{tr}BSAG{/tr}</a></div>
{if $bsag_boxstate eq 'o'}
<div class="box-data" id='bsagBoxCook' style="display:block;">
<div class="box-data" id='bsagBoxCook' style="display:none;">
<div class="copyright" align="center">copyright by BSAG :)</div>

( I was informed that the usage of center / font isn't xhtml compliant, but I'm not an XHTML Guru, so perhaps someone could fix the above lines if he strays around here. )

(Why isn't it possible to do linebreaks in Boxes. grr, so easy :-)
I fixed it in plugin code. nice contribution, I'll have to try that :-) — mose

So this way, the Box always remembers its state. Nice isn't it ? :-)

I hope you like this, let me know.

Maddi, 23. Aug, 2003
Bremen, Germany

peace ;)

Page last modified on Thursday 28 August 2003 13:52:58 GMT-0000