Jump to main content Jump to doc navigation

A simple snippet that will return a value passed through a URL parameter. The Parameter is sanitized and kept below a set size.

Revolution makes it easy to pass URL parameters. This snippet makes it simple to use that URL parameter.

OPTIONS

name - The parameter name, defaults to "p" int - (Opt) Set as true to only allow integer values max - (Opt) The maximum length of the returned value, defaults to 20 default - (Opt) The value returned if no URL parameter is found

Send parameter

[[~10? &val=`5`]]

Retrieve the value

[[!getUrlParam? &name=`val` &int=`1`]]

This snippet needs to be called uncached to get the current value.

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Dannevang Digital
  • Sepia River Studios
  • Chris Fickling
  • CrewMark
  • deJaya
  • Lefthandmedia
  • Murray Wood
  • eydolan
  • Following Sea
  • Anton Tarasov
  • Stéphane Jäggi
  • Raffy
  • Snow Creative
  • A. Moreno
  • Nick Clark
  • JT Skaggs
  • Helen
  • YJ
  • krisznet
  • Richard
  • Yanni

Budget

$301 per month—let's make that $500!

Learn more