Dynamic Parameter Display

by Skyler Katz | Last edited: 9/24/2020

Sometimes you come across a situation where you need to determine what the values of an inline parameter are from a page template. By using a combination of the __parameter__ tag in a show, before_show, or after_show location, as well as the parameter: parameter you can output the content of any parameter.

For this functionality to work you must designate which parameter you would like targeted, and you need to have the __parameter__ tag somewhere in a show location. If you are using JSON there will be a top level key of parameter.

For Example:

// Monklet Code
{​{
  tag="event"
  display="list"
  howmany="1"
  order="recent"
  before_show="<div data-category='__parameter__'></div>"
  parameter="find_category"
}​}

// Monklet being called in a section on a page
{​{special-event-monklet|find_category="youth,children"}​}

// Generated HTML
<div data-category='youth,children'></div>

// Monklet being called in a section on a different page
{​{special-event-monklet|find_category="adults"}​}

// Generated HTML
<div data-category='adults'></div>

// Monklet being called in a section on a different page with no in-line parameter
{​{special-event-monklet}​}

// Generated HTML
<div data-category=''></div>

 

If you have any questions about how to best use this functionality, please reach out to us at