@Adam.Wilson Can we add an example of passing a custom param to a snippet. Or maybe we just need a central article on custom parameters under Liquid Objects and usage, that we could link all the modules’ custom parameter section to.
Title:
Custom Parameters
Description:
Custom parameters can be used with most components and allow the passing of a custom parameter into an instance of a component. This custom parameter can be used to customize an instance of a module/component insertions. For example a custom parameter could be used in a CSS class to affect the styling of a component instant, or it could be used in the logic of a component to show or hide specific parts of a layout.
In this example we’re inserting a snippet component with the custom parameter called “color” and assigning the value of “blue” to a snippet.
{% component type: "snippet", alias: "footer_snippet", color: "blue" %}
Then in the layout we get the value of color and use it as a CSS value:
<p class="{{params.color}}">Some content</p>
1 Like
Hi @Alex_B_Centrifuge
Great idea and thanks for the write-up. I’ll implement this shortly!