by shannah » Mon Oct 01, 2007 1:04 pm
Hi Neil,
Step 1: In your MainTemplate.html file in the part tha displays the sidebars, we change it to something like:
- Code: Select all
{assign var=sidebars value=$page->getRelatedRecordObjects('sidebars')}
{foreach from=$sidebars item=sidebar}
{$sidebar->val('link_label')}
{/foreach}
Note that all we did was create a javascript function named toggle(), then added the onclick event handler to the h3 tag for each sidebar. We also wrapped the sidebar content in a div tag so that the toggle function could toggle the css class of that div tag.
Step 2: Add some styles to your stylesheet for visible and hidden:
[code]
.visible { display: block}
.hidden {display: none}
This is untested and very simplistic, but this can be used as a basis for arbitrarily complex "blinds" functionality.
In the latest version of Dataface I have included scriptaculous and added a smarty tag to add an animated hide/show sidebar.
-Steve