Welcome to Geeklog, Anonymous Friday, April 19 2024 @ 10:40 am EDT

Geeklog Forums

Show/Hide Static Page Block


Status: offline

ScurvyDawg

Forum User
Full Member
Registered: 11/06/02
Posts: 523
OK

So I have in my head
Text Formatted Code

<script language="javascript">
<!--
var state = 'hidden';

function showhide(layer_ref) {

if (state == 'visible') {
state = 'hidden';
}
else {
state = 'visible';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.visibility = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].visibility = state;
}
if (document.getElementById && !document.all) {
maxwell_smart = document.getElementById(layer_ref);
maxwell_smart.style.visibility = state;
}
}
//-->
</script>


 


Now around the code I want to show/hide I use
Text Formatted Code

<div id="agent99" style="position:relative; visibility:hidden;">
My text I want to show/hide.
</div>


 


Now to make the text or button to click to show or hide your data I use.
Text Formatted Code

<a href="javascript://" onclick="showhide('agent99');">Click Here</a>


 


Now I want to wrap a specific static page center block in this so when I click the text that block opens.

How can I customize a specific centerblocks header and footer to allow for this?

Please and thank you praying it will work
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can override the block header and footer templates for static pages centerblocks (in the usual manner), but only for all the static pages there, not for individual ones.

bye, Dirk
 Quote

Status: offline

ScurvyDawg

Forum User
Full Member
Registered: 11/06/02
Posts: 523
well thats not a solution to my problem then .....

Hmmm .... there has gotta be a way to use the unique ID of the static page to create a custom centerblock header and footer......

I will keep investigation, thanks much for your time Dirk.

Peace Giving it a try
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
On my show/hide toggleblocks hack, I use the block_title for the unique name.

so my block header looks something well, exactly like this:
Text Formatted Code
<table width="100%" border="0" cellspacing="0" cellpadding="10" class="blocktable-left">
  <tr>
    <td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td height="22" colspan="3" align="left" valign="middle" class="block-title-left"><a href="#" onclick="showorhide('{block_title}');"><div id="{block_title}1"><img src='{site_url}/tabs/minus.gif' height='10' width='10' border='0' alt='Click Hide Block'></div></a><div>  {block_title}<div><td align="right">{block_help}</td>
        </tr><tr><td width="100%" class="block-info-left"><div id="{block_title}">
<script language='Javascript' type='text/javascript'>
toggle_init('{block_title}');
</script>
 

and my block footer looks like this:
Text Formatted Code
</div></td></tr></table></td></tr></table>
<table cellspacing="0" cellpadding="0" align="center" width="90%" class="block-divider-left"><tr><td><img src="{site_url}/images/speck.gif" width="1" height="1" alt=""></td></tr></table>
 


and then my tabThing.js which includes the toggle script gets included in the header.

Works for static pages too.

And if you do not want all blocks to be affected, just add an if statement to the script.
And Dawg, I know youve seen this script, but just in case, you can get it here.

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

ScurvyDawg

Forum User
Full Member
Registered: 11/06/02
Posts: 523
An if statement OK I will se what I can come up with.

This has exactly the behaviour I want. I just need to come up with the appropriate loop based on the unique name of the centerblock.

Thanks much,

Your right I had seen it before thats why I was so determined that I could find the answer.

Very Happy
 Quote

All times are EDT. The time is now 10:40 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content