<?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: Show rich text value in blog listing page in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333583#M16259</link>
    <description>&lt;P&gt;Hi, thank you for the response.&lt;/P&gt;&lt;P&gt;I dont really know if i really cannot get the text value that was set in blog post editor,&amp;nbsp;it does seem like it is possible according to the article below.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hubspot.com/t5/CMS-Development/Add-module-to-blog-listing-template/td-p/270639" target="_blank"&gt;https://community.hubspot.com/t5/CMS-Development/Add-module-to-blog-listing-template/td-p/270639&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To here:&lt;/P&gt;&lt;P&gt;Is there any other ways to show text module value in blog template?&lt;/P&gt;&lt;P&gt;Or what should I change in the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2020 01:14:16 GMT</pubDate>
    <dc:creator>HiroTahara</dc:creator>
    <dc:date>2020-04-23T01:14:16Z</dc:date>
    <item>
      <title>Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333325#M16242</link>
      <description>&lt;P&gt;So I set several tags for each blog posts when i publish it, but I want to show only one selected tag name for each in the blog listing page as marked below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently it shows one of the tags by Hubl, but instead I want to insert values set in a text module.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image1.PNG" style="width: 885px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/25977i4455E3ABA415109D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image1.PNG" alt="image1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order for that, i created a rich text module named "Blog Tag Replacer" whose variable name is "tag_text_field". And i put it in the blog template.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image2.PNG" style="width: 882px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/25976iAAB6F7AEDCA90DEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="image2.PNG" alt="image2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now in the Blog Content module, I wrote the code below&lt;/P&gt;&lt;P&gt;but the page only shows the tags registered to the blog posts even if the text module has values.&lt;/P&gt;&lt;PRE&gt;{% for module_item in content.widgets %}
  {% if module_item.body.tag_text_field %}{# If text module has a value/ value is not null #}
      &amp;lt;p class="topics-link"&amp;gt;{{ module_item.body.tag_text_field }}&amp;lt;/p&amp;gt;
  {% else %}{# If not, fetch tag names from the tag list of each blog post #}
      {% if content.tag_list %}
        {% for tag in content.tag_list %}
           &amp;lt;p class="topics-link"&amp;gt;{{ tag.name }}&amp;lt;/p&amp;gt;
        {% endfor %}
      {% endif %}
   {% endif %} {# if module_item.body.tag_text_field #}
{% endfor %} {# end for module_item in content.widgets #}&lt;/PRE&gt;&lt;P&gt;I would appreciate your help! Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 09:50:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333325#M16242</guid>
      <dc:creator>HiroTahara</dc:creator>
      <dc:date>2020-04-22T09:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333567#M16258</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/128325"&gt;@HiroTahara&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortanetly Hubspot Bog Listing templates aren't able to pull info from blog posts that are set in Custom Modules. You would need to use Hubspot's default Rich Text or Text module instead. And then the variable would be something like {{ widget_data.&lt;SPAN&gt;module_name.&lt;/SPAN&gt;body.value }} .&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 23:23:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333567#M16258</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2020-04-22T23:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333583#M16259</link>
      <description>&lt;P&gt;Hi, thank you for the response.&lt;/P&gt;&lt;P&gt;I dont really know if i really cannot get the text value that was set in blog post editor,&amp;nbsp;it does seem like it is possible according to the article below.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hubspot.com/t5/CMS-Development/Add-module-to-blog-listing-template/td-p/270639" target="_blank"&gt;https://community.hubspot.com/t5/CMS-Development/Add-module-to-blog-listing-template/td-p/270639&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To here:&lt;/P&gt;&lt;P&gt;Is there any other ways to show text module value in blog template?&lt;/P&gt;&lt;P&gt;Or what should I change in the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 01:14:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333583#M16259</guid>
      <dc:creator>HiroTahara</dc:creator>
      <dc:date>2020-04-23T01:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333600#M16260</link>
      <description>&lt;P&gt;Interesting! I didn't know content.widgets was a thing. Did a little testing on it and it definitely works. Can you show me a screenshot of your Blog Tag Replacer module ? Just want to check that the correct field name is being called.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 02:17:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333600#M16260</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2020-04-23T02:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333607#M16261</link>
      <description>&lt;P&gt;Thank you for testing it!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the snnipet of Blog Tag Replacer module&lt;/P&gt;&lt;P&gt;{% inline_text field="tag_text_field" value="{{ module.tag_text_field }}" %}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and its screenshot.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="blog_tag_replacer_2.PNG" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/26018i4E7699B47764403F/image-size/large?v=v2&amp;amp;px=999" role="button" title="blog_tag_replacer_2.PNG" alt="blog_tag_replacer_2.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="blog_tag_replacer_1.PNG" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/26019i2EB1F888B8955B48/image-size/large?v=v2&amp;amp;px=999" role="button" title="blog_tag_replacer_1.PNG" alt="blog_tag_replacer_1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 02:32:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333607#M16261</guid>
      <dc:creator>HiroTahara</dc:creator>
      <dc:date>2020-04-23T02:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333611#M16262</link>
      <description>&lt;P&gt;Thanks! Hm, you're definitely using the right field name so not sure why it wouldn't be showing your custom tags. May seem like a dumb question, but did you go into any of your posts and add a custom tag to them with the Blog Tag Replacer module?&lt;BR /&gt;&lt;BR /&gt;One thing I did find in testing though is that we won't want our if/else statement happening within the for loop because when it loops over fields that aren't your tag_text_field it's going to run your else statement. So what we'll want to do is create a variable that we can send our tag_text_field value into and then write our if/else statement outside of the for loop.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;{% set custom_tag = [] %} {# create variable for tag #}

{# loop through widgets #}
{% for module_item in content.widgets %}
    {# If tag_text_field is not null, append it to our variable #}
    {% if module_item.body.tag_text_field %}
        {% set custom_tag_append = custom_tag.append(module_item.body.tag_text_field %}
    {% endif %}
{% endfor %}

{# If text module has a value/ value is not null #}
{% if custom_tag %}
    &amp;lt;p class="topics-link"&amp;gt;{{ module_item.body.tag_text_field }}&amp;lt;/p&amp;gt;
{% else %}
{# If not, fetch tag names from the tag list of each blog post #}
    {% if content.tag_list %}
        {% for tag in content.tag_list %}
            &amp;lt;p class="topics-link"&amp;gt;{{ tag.name }}&amp;lt;/p&amp;gt;
        {% endfor %}
    {% endif %}
{% endif %}&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Also, if you want to test if your blog listing is seeing your field at all and contains a value you can try adding the following to your content loop and see if it tag_text_field shows up in the outputted json.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;{% for module_item in content.widgets %}
    {{ module_item.body }}
{% endfor %}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 02:51:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333611#M16262</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2020-04-23T02:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333710#M16274</link>
      <description>&lt;P&gt;Thank you for the code.&lt;/P&gt;&lt;P&gt;I tried some patterns based on yours, but none of them worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like:&lt;/P&gt;&lt;P&gt;1. It doesn't properly give text module value to the variable&lt;/P&gt;&lt;P&gt;2. Text module value doesn't show when embeded in an &amp;lt;a&amp;gt; tag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The codes I tried are below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Use text as variable&lt;/P&gt;&lt;PRE&gt;{% set custom_tag = [] %} {# create variable for tag #}

{# loop through widgets #}
{% for module_item in content.widgets %}
{# If tag_text_field is not null, append it to our variable #}
  {% if module_item.body.tag_text_field %}
    {% set custom_tag_append = custom_tag.append(module_item.body.tag_text_field) %}
  {% endif %}
{% endfor %}

{# If text module has a value/ value is not null #}
{% if custom_tag_append %}
  {% for module_item in content.widgets %}
    &amp;lt;a class="topics-link" href="https://cookie.bizrisk.iij.jp/blog/tag/{{ module_item.body.tag_text_field }}"&amp;gt;{{ module_item.body.tag_text_field }}&amp;lt;/a&amp;gt;
  {% endfor %}
{% else %}
  {# If not, fetch tag names from the tag list of each blog post #}
  {% if content.tag_list %}
    {% for tag in content.tag_list %}
      &amp;lt;a class="topics-link" href="{{ blog_tag_url(group.id, tag.slug) }}"&amp;gt;{{ tag.name }}&amp;lt;/a&amp;gt;
    {% endfor %}
  {% endif %}
{% endif %}&lt;/PRE&gt;&lt;P&gt;2. Use boolean as variable&lt;/P&gt;&lt;PRE&gt;{% set custom_tag = [] %} {# create variable for tag #}

{# loop through widgets #}
{% for module_item in content.widgets %}
{# If tag_text_field is not null, set the variable to True #}
  {% if module_item.body.tag_text_field %}
    {% set custom_tag = True %}
  {% endif %}
{% endfor %}

{# If text module has a value/ value is not null #}
{% if custom_tag %}
  {% for module_item in content.widgets %}
    &amp;lt;a class="topics-link" href="https://cookie.bizrisk.iij.jp/blog/tag/{{ module_item.body.tag_text_field }}"&amp;gt;{{ module_item.body.tag_text_field }}&amp;lt;/a&amp;gt;
  {% endfor %}
{% else %}
  {# If not, fetch tag names from the tag list of each blog post #}
  {% if content.tag_list %}
    {% for tag in content.tag_list %}
      &amp;lt;a class="topics-link" href="{{ blog_tag_url(group.id, tag.slug) }}"&amp;gt;{{ tag.name }}&amp;lt;/a&amp;gt;
    {% endfor %}
  {% endif %}
{% endif %}&lt;/PRE&gt;&lt;P&gt;&amp;gt;&lt;SPAN&gt;did you go into any of your posts and add a custom tag to them with the Blog Tag Replacer module?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Yes, in fact I saw the text modul value shown when I tired this code alone.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the Blog Content module does recognizes the input value.&lt;/P&gt;&lt;PRE&gt;{% for module_item in content.widgets %}
    {{ module_item.body }}
{% endfor %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 09:42:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333710#M16274</guid>
      <dc:creator>HiroTahara</dc:creator>
      <dc:date>2020-04-23T09:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333807#M16283</link>
      <description>&lt;P&gt;Urgh I had a typo in my code. It's supposed to use the custom_tag in the if statement not the module_item.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;{% set custom_tag = [] %} {# create variable for tag #}

{# loop through widgets #}
{% for module_item in content.widgets %}
    {# If tag_text_field is not null, append it to our variable #}
    {% if module_item.body.tag_text_field %}
        {% set custom_tag_append = custom_tag.append(module_item.body.tag_text_field) %}
    {% endif %}
{% endfor %}

{# If text module has a value/ value is not null #}
{% if custom_tag %}
    &amp;lt;p class="topics-link"&amp;gt;{{ custom_tag|join() }}&amp;lt;/p&amp;gt;
{% else %}
{# If not, fetch tag names from the tag list of each blog post #}
    {% if content.tag_list %}
        {% for tag in content.tag_list %}
            &amp;lt;p class="topics-link"&amp;gt;{{ tag.name }}&amp;lt;/p&amp;gt;
        {% endfor %}
    {% endif %}
{% endif %}&lt;/PRE&gt;
&lt;P&gt;If that still doesn't work can you put this in your content loop and see if it outputs anything:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;{% for module_item in content.widgets %}
    {{ module_item.body.tag_text_field }}
{% endfor %}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 13:40:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/333807#M16283</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2020-04-23T13:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/334044#M16301</link>
      <description>&lt;P&gt;Thank you so much, the code totally worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 02:39:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/334044#M16301</guid>
      <dc:creator>HiroTahara</dc:creator>
      <dc:date>2020-04-24T02:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/334046#M16302</link>
      <description>&lt;P&gt;Could i know how you found the usages of variables and other Hubl elements like this?&lt;/P&gt;&lt;PRE&gt;{{ custom_tag|join() }}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I searched for documents and found this and some other similar ones, but they dont have descriptions on those elements in details.&lt;/P&gt;&lt;P&gt;&lt;A href="https://designers.hubspot.com/docs/hubl/variables" target="_blank"&gt;https://designers.hubspot.com/docs/hubl/variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 02:42:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/334046#M16302</guid>
      <dc:creator>HiroTahara</dc:creator>
      <dc:date>2020-04-24T02:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Show rich text value in blog listing page</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/334050#M16304</link>
      <description>&lt;P&gt;Awesome, I'm so glad the code worked!&lt;BR /&gt;&lt;BR /&gt;They talk about creating variables a little bit here -&amp;nbsp;&lt;BR /&gt;&lt;A href="https://designers.hubspot.com/docs/hubl/variables-macros-syntax" target="_blank"&gt;https://designers.hubspot.com/docs/hubl/variables-macros-syntax&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The |join piece is a filter and you can read all about those here -&amp;nbsp;&lt;BR /&gt;&lt;A href="https://designers.hubspot.com/docs/hubl/filters" target="_blank"&gt;https://designers.hubspot.com/docs/hubl/filters&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;.append() is a function that can be read about here -&lt;BR /&gt;&lt;A href="https://designers.hubspot.com/docs/hubl/functions" target="_blank"&gt;https://designers.hubspot.com/docs/hubl/functions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The set variables to store information that can be used outside of loops is something I saw used here in the community and I actually have a blog post that goes into detail on how to use the .append and .update functions for doing this.&lt;BR /&gt;&lt;A href="https://alyssawilie.com/blog/how-to-hubl/arrays-append-and-update/" target="_blank"&gt;https://alyssawilie.com/blog/how-to-hubl/arrays-append-and-update/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope all this information helps!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 02:56:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Show-rich-text-value-in-blog-listing-page/m-p/334050#M16304</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2020-04-24T02:56:02Z</dc:date>
    </item>
  </channel>
</rss>

