<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is it possible to set up conditional branching of content by template type? in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Is-it-possible-to-set-up-conditional-branching-of-content-by/m-p/969536#M38847</link>
    <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/749449"&gt;@TMisuna&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Welcome to our community! Great question. Have you tried something like this?&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;&amp;lt;div class="breadcrumb"&amp;gt;
  &amp;lt;ul class="breadcrumb__list"&amp;gt;
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="/" class="breadcrumb__link"&amp;gt;HOME&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;

    {% if content.content_type == "BLOG_POST" %}
    &amp;lt;!-- Display this part only in the blog_post template --&amp;gt;
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ content.blog_group.absolute_url }}" class="breadcrumb__link"&amp;gt;{{ content.blog_group.html_title }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
    {% endif %}

    {% if content.topic_list and content.topic_list | length &amp;gt; 0 %}
    {% set topic = content.topic_list[0] %}
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ content.blog_group.absolute_url }}/tag/{{ topic.slug }}" class="breadcrumb__link"&amp;gt;{{ topic.name }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
    {% endif %}

    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ content.absolute_url }}" class="breadcrumb__link"&amp;gt;{{ content.name }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that doesn't work for you, please post back and we'll see what else might help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Jaycee&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2024 22:50:03 GMT</pubDate>
    <dc:creator>Jaycee_Lewis</dc:creator>
    <dc:date>2024-04-30T22:50:03Z</dc:date>
    <item>
      <title>Is it possible to set up conditional branching of content by template type?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Is-it-possible-to-set-up-conditional-branching-of-content-by/m-p/968905#M38831</link>
      <description>&lt;P&gt;I have created the source code to generate the&amp;nbsp;breadcrumbs in my theme.&lt;BR /&gt;However, the commented out section is the breadcrumbs listing that I want to display only in the blog_post template.&lt;BR /&gt;I know HubSpot has various template types, page / blog_post / blog_listing, etc., but is it possible to apply conditional branching by template type?&lt;BR /&gt;&lt;STRONG&gt;I'm thinking of it like is_page() or is_single() in WordPress, but is this wrong?&lt;/STRONG&gt;&lt;BR /&gt;I searched for a way to write something like “if blog_post” but couldn't find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="breadcrumb"&amp;gt;
  &amp;lt;ul class="breadcrumb__list"&amp;gt;
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="/" class="breadcrumb__link"&amp;gt;HOME&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;

    &amp;lt;!-- Is it possible to display this part only in the blog_post template? Is there a conditional branch like if blog_post? --&amp;gt;
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ group.absolute_url }}" class="breadcrumb__link"&amp;gt;{{ group.html_title }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
    &amp;lt;!-- end --&amp;gt;

    {% if content.topic_list and content.topic_list | length &amp;gt; 0 %}
    {% set topic = content.topic_list[0] %}
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ group.absolute_url }}/tag/{{ topic.slug }}" class="breadcrumb__link"&amp;gt;{{ topic.name }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
    {% endif %}

    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ content.absolute_url }}" class="breadcrumb__link"&amp;gt;{{ content.name }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 07:49:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Is-it-possible-to-set-up-conditional-branching-of-content-by/m-p/968905#M38831</guid>
      <dc:creator>TMisuna</dc:creator>
      <dc:date>2024-04-30T07:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set up conditional branching of content by template type?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Is-it-possible-to-set-up-conditional-branching-of-content-by/m-p/969536#M38847</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/749449"&gt;@TMisuna&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Welcome to our community! Great question. Have you tried something like this?&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;&amp;lt;div class="breadcrumb"&amp;gt;
  &amp;lt;ul class="breadcrumb__list"&amp;gt;
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="/" class="breadcrumb__link"&amp;gt;HOME&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;

    {% if content.content_type == "BLOG_POST" %}
    &amp;lt;!-- Display this part only in the blog_post template --&amp;gt;
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ content.blog_group.absolute_url }}" class="breadcrumb__link"&amp;gt;{{ content.blog_group.html_title }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
    {% endif %}

    {% if content.topic_list and content.topic_list | length &amp;gt; 0 %}
    {% set topic = content.topic_list[0] %}
    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ content.blog_group.absolute_url }}/tag/{{ topic.slug }}" class="breadcrumb__link"&amp;gt;{{ topic.name }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
    {% endif %}

    &amp;lt;li class="breadcrumb__item"&amp;gt;
      &amp;lt;a href="{{ content.absolute_url }}" class="breadcrumb__link"&amp;gt;{{ content.name }}&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that doesn't work for you, please post back and we'll see what else might help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 22:50:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Is-it-possible-to-set-up-conditional-branching-of-content-by/m-p/969536#M38847</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-04-30T22:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set up conditional branching of content by template type?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Is-it-possible-to-set-up-conditional-branching-of-content-by/m-p/969573#M38849</link>
      <description>&lt;P&gt;Thanks for your valuable answers! However, it did not work. I actually opened a blog page with “templateType: blog_post” and looked at the JSON structure in HubSpot's developer tools, but could not find the “content.content_type” as data. So my blog_post page description may be wrong (no content_type).&lt;BR /&gt;I will look into it. By the way, is the description {% if content.content_type == “BLOG_POST” %} a common way for HubSpot engineers to write other templateTypes? Sorry I don't know much about it.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 00:11:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Is-it-possible-to-set-up-conditional-branching-of-content-by/m-p/969573#M38849</guid>
      <dc:creator>TMisuna</dc:creator>
      <dc:date>2024-05-01T00:11:49Z</dc:date>
    </item>
  </channel>
</rss>

