Skip to main content

r:set_var

<r:set_var />

This tag is used to set a variable.

Attribute Options

name="something" - The name of the variable.

value="something" - The value of the variable you’re setting.

default="something" - Crate a default value for the value attribute.

Example

<r:set_var name="archive_month" value="Dec2015" default="Nov2015" />

You can also set the value by not self-closing the tag:

<r:set_var name="salary_range">
  I'm the value
</r:set_var>

To expand on the example above, you can also set variables via Custom Data:

<r:set_var name="archive_month">
  <r:page:content name="archive_month" />
</r:set_var>

Note: Do not to use dashes (-) in variable names. Dashes are considered “minus” logic and will have unintended consequences.

This tag is closely related to r:var.

Last updated on January 2, 2020.

We welcome all questions, feedback and bug reports. If you're having an issue, we usually need the following information:

  • A brief description of the issue
  • A link to the page where you saw the issue
  • Screenshots that illustrate the problem - How do I take a screenshot?

Kindly email CleanSlate@mail.wvu.edu for help or use the form on the request help page.