Skip to main content

r:page:first_non_blank_attr

<r:page:first_non_blank_attr />

This pulls the first non-blank attribute from the CleanSlate page properties, in the order that you give it. Consider the following example:

<r:page:first_non_blank_attr names="title, name" />

In the example, this would be like saying if the  <r:page:title /> attribute exists, use it. Otherwise, use  <r:page:name />. This depends on what information the user has given CleanSlate.

{{ var | default: "Hello" }}

This pulls the first non-blank attribute from a CleanSlate object, in the order from left to right.

Example

{{ page.title | default: page.name }}

In the example, this says if {{ page.title }} attribute exists, use it. Otherwise, use {{ page.name }}. This depends on what information the user has entered into the CleanSlate Page Properties modal.

You can also chain multiple | default: statements:

{{ page.title | default: page.created_at | default: page.name }}

This checks for a page title, then, if that doesn't exist, checks for when the page was created, then, if that doesn't exist, outputs the page's name.

Last updated on March 16, 2021.

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.