[ic] category_vert_toggle

Gary E. Miller gem at rellim.com
Thu Aug 28 22:05:53 EDT 2003


Yo All!

I got category_vert_toggle to work for me.  Not sure if this is the way to
do it, but it worked for me.

The problem was explained in my previous email.

The patch is two part.  The first part is to precompute what the URL
for the current page should be.  If the URL has params in it, then append
an ?, otherwise append an &.

Then use this partial URL to append the appropriate expand,contract parameters.

Please consider this patch for the CVS.  Or drop me some clues on a better
way to do this.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 20340 Empire Blvd, Suite E-3, Bend, OR 97701
	gem at rellim.com  Tel:+1(541)382-8588 Fax: +1(541)382-8676

---------- Forwarded message ----------
Date: Thu, 28 Aug 2003 20:45:27 -0700 (PDT)
From: gem <gem at www.deleone.com>
To: gem at rellim.com

--- category_vert_toggle.DIST	Thu Aug 28 20:44:42 2003
+++ category_vert_toggle	Wed Aug 27 23:33:35 2003
@@ -102,16 +102,25 @@

 	return('');
 [/perl]
+[seti oldhref][history-scan exclude=nothing][/seti]
+[calc]
+        if ( $Scratch->{oldhref} =~ /html$/ ) {
+		$Scratch->{oldhref} .= '?';
+	} else {
+		$Scratch->{oldhref} .= '&';
+	}
+	return;
+[/calc]

 <tr>
     <td valign="top" align="right" colspan=3>
-	<a href="[history-scan]&expandall=1">
+	<a href="[scratch oldhref]expandall=1">
 	[scratch showtoggleon]
 	<font class="categorybar"><b>[L]Show All Subcategories[/L]</b></a>
 </tr>
 <tr>
     <td valign="top" align="right" colspan=3>
-	<a href="[history-scan]&collapseall=1">
+	<a href="[scratch oldhref]collapseall=1">
 	[scratch showtoggleoff]
 	<font class="categorybar">
 	<b>[L]Collapse All Categories[/L]</b></a>
@@ -149,9 +158,9 @@
 	    [condition]
 		return($Scratch->{expandarea}{"[box-code]"});
 	    [/condition]
-		<a href="[history-scan]&collapse=[box-code]">[scratch showtoggleoff]</a>
+		<a href="[scratch oldhref]collapse=[box-code]">[scratch showtoggleoff]</a>
     	[else]
-		<a href="[history-scan]&expand=[box-code]">[scratch showtoggleon]</a>
+		<a href="[scratch oldhref]expand=[box-code]">[scratch showtoggleon]</a>
 	[/else]
 	[/if]
     </td>


More information about the interchange-users mailing list