Re: [cgi-prototype-users] linking to non-default page
Generally, here's how I've dealt with it: Make your link on the welcome page something along the lines of: wrote: > > I'm just starting to try to wrap my head around C::P::Hidden (or vice > versa), so it's entirely possible I'm not thinking about this properly > -- but I can't figure out the Right Way to link to a non-default page. > > Suppose I have two "pages": Welcome and Login. (A "page" is a > combination of a .pm and a .tt; there's only one actual CGI.) I have > > sub config_default_page { "Welcome" } > > in the base My::App.pm. > > In Welcome.tt, I want to have an element where the href attribute > takes me to the Login page. It seems like I have two options: > > 1) use an onClick attribute to manipulate the hidden _state field to >change its value to 'Login' > 2) encode '?_state=Login' into the URL in the href attribute (or various >other schnanigans with specifying some state in the URL -- use >'state=login' and switch on that in the respond_per_page() in the >base class, for example) > > Is that pretty much accurate or is there some slickness I'm missing? > > thanks, > john. -- Andrew Gianni Administrative Computing Services State University of New York at Buffalo 215 Millard Fillmore Academic Complex Amherst, NY 14261 (716) 645-3587x7124 --- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click ___ cgi-prototype-users mailing list cgi-prototype-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users
Re: [cgi-prototype-users] linking to non-default page
> "Randal" == Randal L Schwartz writes: Randal> Then I can say: Randal> [% WRAPPER link state = "Login" %]Login![% END %] No, that's not right. I have to do something with a href =. Not sure how I was using that here. :) Randal> --- Randal> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies Randal> from IBM. Find simple to follow Roadmaps, straightforward articles, Randal> informative Webcasts and more! Get everything you need to get up to Randal> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click Randal> ___ Randal> cgi-prototype-users mailing list Randal> cgi-prototype-users@lists.sourceforge.net Randal> https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! --- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click ___ cgi-prototype-users mailing list cgi-prototype-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users
Re: [cgi-prototype-users] linking to non-default page
> "john" == John S J Anderson <[EMAIL PROTECTED]> writes: john> 2) encode '?_state=Login' into the URL in the href attribute (or various john>other schnanigans with specifying some state in the URL -- use john>'state=login' and switch on that in the respond_per_page() in the john>base class, for example) I've used this, and recommend this. In the fictional CGI::Prototype::Cookbook, I have this: USE selfcgiurl = url(self.CGI.url({ path => 1 })); BLOCK link; # [ state = "new state" ] (defaults to current state) # [ other = { ... } ] (additional URL params) csp = self.config_state_param; DEFAULT state = self.param(csp); DEFAULT other = {}; other.$csp = state; selfcgiurl(other); END; Then I can say: [% WRAPPER link state = "Login" %]Login![% END %] Note that this requires config_state_param to not begin with an underscore or dot, thanks to some odd interactions with TT's restrictions. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! --- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click ___ cgi-prototype-users mailing list cgi-prototype-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users