Skip to content

Instantly share code, notes, and snippets.

@spingary
Created November 14, 2014 05:29
Show Gist options
  • Save spingary/4f1e05e57dd4b3aa474d to your computer and use it in GitHub Desktop.
Save spingary/4f1e05e57dd4b3aa474d to your computer and use it in GitHub Desktop.
Hubspot Jinja - example use of set, length, split in a blog template
{% set topicarray=(request.path | split('/topic/')) %}
{% if topicarray|length == 2 %}
{% set topic=topicarray|last %}
{% if topic == 'following-jesus' %}
<div class="podcast-topic-desc row-fluid">
<div class="span5"><img src="http://cdn2.hubspot.net/hub/320254/file-2083433070-jpg/images/LIVEIT_SERMON_SERIES/podcast-cat-following.jpg?t=1415895975667" alt="Following Jesus"></div>
<div class="span7">
<h3>Following Jesus: The Ultimate Adventure</h3>
<p>Jesus called each of his disciples to &quot;Follow Me!&quot; To eat, drink, walk, travel,
and live with HIM! He calls us to be his disciples and to follow him as well. This series
is a look at Jesus' interactions and training with his disciples. What does it look like to
follow Jesus in our lives? What should we expect? How will it impact our lives? How will it
impact your life?
</p>
</div>
</div>
{% elif topic == 'origins' %}
.....
{% else %}
<h1>Others</h1>
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment