Aug 7, 20189:20 AM - bearbeitet Aug 7, 20189:37 AM
Trendsetter/-in | Elite Partner
Excluding a blog topic from a Topics list
lösung
@Octo - I see... I don't think you can chain an expression test to a filter in a loop since the loop hasn't returned the string yet and you can't access the dict child of name in the topic. I think this might be a better approach (maybe less elegant though)
{% for topic in content.topic_list %}
{% if !topic.name is string_startingwith "High" %}
<div class="topic">{{ topic|pprint }}</div>
{% endif %}
{% endfor %}
Or, slightly more elegant...
{% for topic in content.topic_list %} {{ '<div class="topic">'+topic.name+'</div>' if !topic.name is string_startingwith "High" }} {% endfor %}
If this answer helped, please, mark as solved 😄
tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.
Aug 7, 20189:20 AM - bearbeitet Aug 7, 20189:37 AM
Trendsetter/-in | Elite Partner
Excluding a blog topic from a Topics list
lösung
@Octo - I see... I don't think you can chain an expression test to a filter in a loop since the loop hasn't returned the string yet and you can't access the dict child of name in the topic. I think this might be a better approach (maybe less elegant though)
{% for topic in content.topic_list %}
{% if !topic.name is string_startingwith "High" %}
<div class="topic">{{ topic|pprint }}</div>
{% endif %}
{% endfor %}
Or, slightly more elegant...
{% for topic in content.topic_list %} {{ '<div class="topic">'+topic.name+'</div>' if !topic.name is string_startingwith "High" }} {% endfor %}
If this answer helped, please, mark as solved 😄
tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.
@Octo - The html should actually be smaller if you use the second option I gave you. Also, not quite sure what you mean by the HTML being smaller. HUBL code is ran on the server side and not the client side.
If you're worrying about too much data being pulled into the template, you shouldn't have to worry about that since all the filter does is sanitize the data after it's available anyway. You can see this by viewing the developer info for the page.