Complete HubsPot Hubl Tutorial Guide

Angelic Sanoy

Angelic Sanoy

Founder | Bookworm Head

BookwormHead » Blog » Design » Complete HubsPot Hubl Tutorial Guide

Hiding an Element Inside Page Editor Via HusBpot HubL

Basically the if statement allows you to show only an element inside the if statement.

What code says:
If the user doesn’t use the page editor, the post-body will have a wrap id called contents.

{% if is_in_editor  %}  
               {{ content.post_body }}  
                {% else %}
<div id="contents">{{ content.post_body }}</div>
{% endif %}