[Chameleon] Dynamic Button in Template

Paul Spencer pspencer at dmsolutions.ca
Thu Apr 7 22:07:51 EDT 2005


Yes there is :)

in your template, create a hidden input to hold the value passed to the 
application.  Lets assume it is called "returnTo":

<input type="hidden" name="returnTo" value="[$returnTo|default.php$]">

and then in the href value you can use the same thing:

<a href="http://some/server/[$returnTo|default.php$]">return</a>

The value of returnTo is taken from the URL on the first page load and 
substituted into both the hidden input and the a tag.  As the user 
navigates, however, the page is submitted and the original value is lost 
unless you preserve it.  The easiest way to do this is to use the hidden 
input trick presented here.

Cheers

Paul

Pascoe,Tim [Burlington] wrote:
>         I did a quick search in the archives, but came up empty. I have 
> a Chameleon 2.0 map page which is accessed from several different 
> locations in my application, depending on what is to be mapped. I need 
> to set an HREF value on my template to return to the original page 
> requesting the map. Does this make sense? This would bypass the need for 
> a user to use the back button several times if the map had been redrawn 
> multiple times; it would jump directly to the original calling page. I 
> pass the name of the page which originally requested the map to 
> Chameleon in the FORM, but I’m not sure how I can insert this FORM value 
> into the page generated from the template. Is there a simple way to do this?
> 
> Timothy Pascoe
> 
> 
> Environment Canada / Environnement Canada
> Canada Centre for Inland Waters / Centre Canadien des Eaux Intérieures
> 867 Lakeshore Road / 867, chemin Lakeshore
> Burlington, Ontario / Burlington (Ontario)
> 
> L7R 4A6
> 
> Tel/Tél: (905) 336-6239
> Fax/Téléc: (905) 336-4699
> E-mail/C. élec: ___tim.pascoe at ec.gc.ca_ <mailto:tim.pascoe at ec.gc.ca>
> Government of Canada/Gouvernement du Canada
> 
> /This e-mail represents the opinions and views solely held by its author 
> and in no manner may be considered as representing those of his/her 
> employer./
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list