We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

URL parameters question

Development and Programming

spaceageliving's avatar
spaceageliving
1 posts
14 years ago
spaceageliving's avatar spaceageliving

Hi–newbie EE questions here.

I want to access URL parameters in a template. This is a two part question I suppose:

1) I’ve learned that the $_GET supervar is munched by EE upstream, so using $_GET to retrieve a URL parameter is out (?), and I’ve also tried:

$this->EE->input->get('parameter_name');

which also fails (returns FALSE) even though the parameter is present in URL…

So, is it possible to retrieve typical ‘?parameter_name=x’ parameters within a template?

2) I’m assuming that a better way to handle this is via a properly formatted friendly URL, ie:

/channel/template/parameter_name/value

but alas even though the EE docs allude to this capability, I am unable to find helpful instructions on how to configure such. Can somebody point me in the right direction on this?

Thanks!

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
14 years ago
Lisa Wess's avatar Lisa Wess

Welcome to the forums, spaceageliving -

Have you seen the docs on URL segments? You should be able to simply pull in {segment_1}, {segment_2}, etc.

       
spaceageliving's avatar
spaceageliving
1 posts
14 years ago
spaceageliving's avatar spaceageliving

OK, great, thanks I hadn’t seen the page you recommend, very helpful.

So, I’ve “inherited” this code from a previous developer, and the url is formed like so:

/solutions/exceptional-donors/donor-database/donor-search-results/?sortby=donor_donors.donor_number&ℴ=desc

where ‘donor-search-results’ is referenced to the template in question.

If I want the two params to map to the {segment} vars, would this URL work:

/solutions/exceptional-donors/donor-database/donor-search-results/donor_donors.donor_number/desc

or alternatively:

/solutions/exceptional-donors/donor-database/donor-search-results/?donor_donors.donor_number/desc

Thanks for your help!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.