• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How do I use {{module_url param='color' -%}} as a conditional variable

Explorer ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

I've tried:

{% assign color = {{module_url param='color' -%}} -%}

{% if color == 'red' -%}

<p>Red is the color</p>

{% endif -%}

and lots of variations and nothing works.

TOPICS
Content management and modules

Views

373

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 02, 2018 Oct 02, 2018

Hi there . A few errors with the above.

Modules are not double braces, only single.

You also do not need to use that module if you are using liquid to access a parameter. I suggest using the reference quite closely to help you.

Filters | Business Catalyst Support

Just access the parameter in the url using -

{{globals.get.color}}

{% assign color = globals.get.color -%}

{% if color == 'red' -%}

<p>Red is the color</p>

{% endif -%}

Or even shorter:

{% if globals.get.color == 'red' -%}

<p>Red is the color</p>

...

Votes

Translate

Translate
LEGEND ,
Oct 02, 2018 Oct 02, 2018

Copy link to clipboard

Copied

LATEST

Hi there . A few errors with the above.

Modules are not double braces, only single.

You also do not need to use that module if you are using liquid to access a parameter. I suggest using the reference quite closely to help you.

Filters | Business Catalyst Support

Just access the parameter in the url using -

{{globals.get.color}}

{% assign color = globals.get.color -%}

{% if color == 'red' -%}

<p>Red is the color</p>

{% endif -%}

Or even shorter:

{% if globals.get.color == 'red' -%}

<p>Red is the color</p>

{% endif -%}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines