Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Embperl

equivalent of [$ hidden $] for links?

 

 

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded


smithm at gmail

Jun 6, 2007, 12:10 PM

Post #1 of 3 (1356 views)
Permalink
equivalent of [$ hidden $] for links?

Hi there

[$ hidden $] is very handy for making sure form variables get passed
from one page to another, but is there anything similar for links?

That is to say, if the url is

page.epl?param1=x&param2=y

and I have a link on a page in which I also want to include param1 and
param2 ...

say <a href="/page2.epl?param3=z"/>

in which I also want to pass param1 and param2, is there simple way to
do it, such that any parameters not included in this link are
inherited?

Thanks

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


andrewo at oriel

Jun 6, 2007, 6:50 PM

Post #2 of 3 (1236 views)
Permalink
RE: equivalent of [$ hidden $] for links? [In reply to]

Hi Michael,

> [$ hidden $] is very handy for making sure form variables get passed
> from one page to another, but is there anything similar for links?
>
> That is to say, if the url is
>
> page.epl?param1=x&param2=y
>
> and I have a link on a page in which I also want to include param1 and
> param2 ...
>
> say <a href="/page2.epl?param3=z"/>
>
> in which I also want to pass param1 and param2, is there simple way to
> do it, such that any parameters not included in this link are
> inherited?

I can't think of a way off the top of my head but I'm not a heavy user
of 2.x (most of my production stuff still runs 1.3x!). There is a
shortcut that might help you keep track of things:

<a href="/page2.epl?[+ \%url_params +]">

Or, depending on what you wanted to override and pass through:

[.#
process fdat, perform form actions and delete items that you know
are not pure content (eg submit button values etc) from fdat here.
Or stick them in another hash. Whatever works for your page logic.
#]
<a href="/page2.epl?[+ { %fdat, param3 => 'z'' } +]">

Like I said, there may well be a way overriding some of the Embperl
syntax stuff but the above is perhaps clearer. Well, to me anyway :)


Cheers,

Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


smithm at gmail

Jun 8, 2007, 2:06 AM

Post #3 of 3 (1230 views)
Permalink
Re: equivalent of [$ hidden $] for links? [In reply to]

Thanks Andrew, the suggestions seem great.

Michael


On 6/7/07, Andrew O'Brien <andrewo [at] oriel> wrote:
>
> Hi Michael,
>
> > [$ hidden $] is very handy for making sure form variables get passed
> > from one page to another, but is there anything similar for links?
> >
> > That is to say, if the url is
> >
> > page.epl?param1=x&param2=y
> >
> > and I have a link on a page in which I also want to include param1 and
> > param2 ...
> >
> > say <a href="/page2.epl?param3=z"/>
> >
> > in which I also want to pass param1 and param2, is there simple way to
> > do it, such that any parameters not included in this link are
> > inherited?
>
> I can't think of a way off the top of my head but I'm not a heavy user
> of 2.x (most of my production stuff still runs 1.3x!). There is a
> shortcut that might help you keep track of things:
>
> <a href="/page2.epl?[+ \%url_params +]">
>
> Or, depending on what you wanted to override and pass through:
>
> [.#
> process fdat, perform form actions and delete items that you know
> are not pure content (eg submit button values etc) from fdat here.
> Or stick them in another hash. Whatever works for your page logic.
> #]
> <a href="/page2.epl?[+ { %fdat, param3 => 'z'' } +]">
>
> Like I said, there may well be a way overriding some of the Embperl
> syntax stuff but the above is perhaps clearer. Well, to me anyway :)
>
>
> Cheers,
>
> Andrew
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe [at] perl
> For additional commands, e-mail: embperl-help [at] perl
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.