OctoberCMS set param in configuration section of template

95 Views Asked by At

I'm trying to render a conditional form to a twig template in OctoberCMS...

[renderForm] formCode = "contact-form"
==
{% if data.show_form == true %}
    <div class="container">
        <div class="row">
            <div class="col unnamed-character-style-86">
                This will be a form {{ data.form_to_show }}!!!
                {% component 'renderForm' %}
            </div> 
        </div> 
    </div> 
{% endif %}

I need to set the formCode variable to the template data data.form_to_show you can see in the twig section.

I'm really new to October and am a bit stuck on this but it sounds like it should be simple enough.

All help welcome.

1

There are 1 best solutions below

0
On BEST ANSWER

I was being an idiot and worked it out myself.

[renderForm] formCode = {{ data.form_to_show }}