[Chameleon] Dynamic Template Changes
Jason Fournier
jfournier at dmsolutions.ca
Sun Aug 22 15:45:25 EDT 2004
Steven,
This is achievable in Chameleon 1.99 'Application mode' (ie, not Service
Instance) by adding some custom script to the phtml file which includes
your template prior to processing. I'm not sure of the impact it would
have on the Javascript CWC object and it's associated variables
(goCWCJSAPI). My guess is that it would behave similarly between pages.
A simplified version of the script would be something like:
if( isset( $_GET['curForm'] ) )
{
// perform checks here if necessary (eg, user submitted template)
$szMapFile = 'path/to/' . $_GET['curForm'];
}
else
$szMapFile = 'path/to/template.html';
The mechanism described above doesn't exist in CWC2 (as we all know)
because it is a service instance of Chameleon and operates in a
different manner. I'm not sure what it would take to add a method
similar to the one above to handle this in 1.0.x.
If this is a development environment ideally you would upgrade to
Chameleon 1.99Beta2 and use its Service Instance along with the
application. This would have the added bonus of assisting us in
ensuring stable code prior to release :) I can understand, however, and
appreciate that custom code has been added to your application and you
require the most stable version possible.
Hope this helps,
Jason
D'cruz,Steven [Ontario] wrote:
> Greetings,
>
> I'm currently using Chameleon v.1.0.5, and would like to enquire
> as to whether it is possible to create a button, which, if clicked,
> would send the user to a different template while preserving the current
> Javascript CWC object and it's associated variables (goCWCJSAPI). The
> reason for this requirement is that I've created two distinct templates;
> simple and advanced. The simple template has considerably less
> functionality than the advanced, although it is much more intuitave. I
> would like to create a button on the simple template that reloads the
> current map with a new template ( the advanced template ) while
> preserving the state of the map (layer status, zoom depth, etc). Is
> this possible in version 1.0.5 of Chameleon/CWC2? If not, I'd greatly
> appreciate suggestions for adding this functionality. If this
> functionality exists in later versions, would it be plausible to port
> the changes from the newer chameleon version to version 1.0.5? Although
> upgrading our version of Chameleon is a possibility, I've been asked to
> avoid doing so unless absolutely necessary, as many customizations have
> been made to it.
>
> Note: I currently have the Chameleon 1.99 b2 samples running, however
> our application is primarily for the CWC component, which does not seem
> to be fully implemented in the beta release. Upgrading may be
> considered once version 2.0 of Chameleon/CWC2 is released
>
> Steven D'Cruz
>
> (Open)GIS Developer
>
> Environment Canada
>
> Steven.D'Cruz at ec.gc.ca
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
--
_____________________________
10 Jason Fournier
20 Applications Development
40 DM Solutions Group Inc.
50 jfournier at dmsolutions.ca
60 GOTO www.dmsolutions.ca
70 REM 613.565.5056 x18
More information about the Chameleon
mailing list