CMS Development

Neu
Member

Toggle form visible or invisible when there is no tittle to the form

SOLVE
How do I manage to NOT display the signup form when there is no title to the form?

{# Right Column #} <div class="span4 tl md-mb30" id="contact"> {% if not module.title %} <style> .hs_cos_wrapper .form-title:empty { display: none; } </style> {% endif %} {# Signup Form #} <div class="{% if footer.white_content %}white-content {% endif %}form-button-theme"> <h2 class="mt0"> {{ footer.form_header }} </h2> {% form form_to_use="{{ footer.form.form_id }}" response_response_type="{{ footer.form.response_type }}" response_message="{{ footer.form.message }}" response_redirect_id="{{ footer.form.redirect_id }}" response_redirect_url="{{footer.form.redirect_url}}" gotowebinar_webinar_key="{{ footer.form.gotowebinar_webinar_key }}" %} </div> </div>


I can seem to get that one right remove that???
0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Toggle form visible or invisible when there is no tittle to the form

SOLVE

Hey @Neu 

 

Let me rephrase this to ensure my understanding:

 

UCP 1

Given: The page author does no enter a a value for the form

When: The end user visits the page

Then: Do not display the form

 

UCP 2

Given: The page author enters a a value for the form

When: The end user visits the page

Then: Display the form

 

If this is the case you'll want to check the title's value length rather than if it exists or not:

{% if module.title|length <= 0%}
  {# Don't display #}
{% else %}
  {# Display this content #}
{% endif %}

 

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

1 Reply 1
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Toggle form visible or invisible when there is no tittle to the form

SOLVE

Hey @Neu 

 

Let me rephrase this to ensure my understanding:

 

UCP 1

Given: The page author does no enter a a value for the form

When: The end user visits the page

Then: Do not display the form

 

UCP 2

Given: The page author enters a a value for the form

When: The end user visits the page

Then: Display the form

 

If this is the case you'll want to check the title's value length rather than if it exists or not:

{% if module.title|length <= 0%}
  {# Don't display #}
{% else %}
  {# Display this content #}
{% endif %}

 

Kevin Cornett - Sr. Solutions Architect @ BridgeRev