HCO
HCO

Reputation: 7

Structure Tags in hubl - Hubspot for a Post

i'm working in a blog helpcenter using hubl in Hubspot. I would like to structure the posts by subtags. https://postimg.cc/47q72hWK

Subtag 1

posts

Subtag 2

posts

I have no clue how to do this I tried GPT but nothing works.

I've modified an existent module:

{% import '/Spark child/pages/macros/macros.html' as components %}

<section class="thumbnail-links-wrapper thumbnail-links-wrapper--blog">
  
  <div class="thumbnail-links-wrapper__items" data-per-row="3">
    {% for content in contents %}
      {{ components.thumbnail_link_blog_post(content, {
        default_thumbnail: module.default_featured_image.src,
        show_category: module.show_tags,
        show_all_category: module.show_all_tags,
        show_summary: group.show_summary_in_listing
      }) }}
    {% endfor %}
  </div>
</section>

This module is called here:

{% block body %}
    {% if "all" in request.path %}
      <!-- Show "ALL posts" if the URL contains "all" -->
        <div class="main">
          <div class="breadcrumb">
            <ul>
              <li>
                <a href="https://ai.reportlinker.com/intelligence-portal-user-admin-guide">Home</a> >
              </li>
              <li>
                All articles
              </li>
            </ul>
          </div>

          <div>
            <h1>All articles</h1>
          </div>
          {% module "module_173445347010848" path="/Spark child/modules/_global/Blog Index", label="Blog Index" %}
        </div>
    {% else %}
    {% if tag %}
      <!-- If a tag exists, display its information -->
      <div class="main">
        {% module "module_173451937964725" path="/Spark child/modules/Breadcrumb Article", label="Breadcrumb Article" %}
        
        <div>
          <h1>{{ page_meta.html_title | split(' | ') | last }}</h1>
        </div>
        {% module "module_17347093347845" path="/Spark child/modules/_global/Blogs Structure", label="Blogs Structure" %}
      </div>

    {% else %}
      {% dnd_area "blog_index" %}
        {% dnd_section 
          full_width=true, 
          background_image={
            'backgroundPosition': 'MIDDLE_CENTER',
            'backgroundSize': 'cover',
            'imageUrl': get_asset_url('../images/stock/blog-index-banner.png')
          }, 
          padding={ "top": 225, "bottom": 225 } 
        %}
        {% end_dnd_section %}

        {% dnd_section max_width=1366, padding={ "top": 0, "bottom": 0 } %}
          {% dnd_column
            padding={
              "default": {
                "top": 70,
                "left": 80,
                "right": 80
              },
              "mobile": {
                "top": 60,
                "bottom": 20,
                "left": 20,
                "right": 20
              }
            },
            margin={
              "default": {
                "top": -200
              },
              "mobile": {
                "top": -20
              }
            },
            background_color="#ffffff"
          %}
            {% dnd_row
              padding={
                "default": {
                  "bottom": 100,
                  "left": "20%",
                  "right": "20%"
                },
                "mobile": {
                  "bottom": 20,
                  "left": 0,
                  "right": 0
                }
              } %}
              {% dnd_module path="@hubspot/rich_text" %}
                {% module_attribute "html" %}
                  <h1 style="text-align: center;">{{ group.public_title }}</h1>
                  <p style="text-align: center;">{{ group.description }}</p>
                {% end_module_attribute %}
              {% end_dnd_module %}
            {% end_dnd_row %}
            
            {% dnd_row %}
              {% dnd_module path="../modules/_global/Blog Index" %}{% end_dnd_module %}
            {% end_dnd_row %}
          {% end_dnd_column %}
        {% end_dnd_section %}
      {% end_dnd_area %}
    {% endif %}
  {% endif %}

This one is the macros for posts:

{%- macro thumbnail_link(link, options = {}) -%}
    <div class="thumbnail-link thumbnail-link--{{ slug(link.category.name or link.category) }}">
        <div class="thumbnail-link__inner">
            {% if options.hide_thumbnail != true %}
              <a class="thumbnail-link__thumbnail-wrapper"
                        {% if link.url %}
              href="{{ link.url }}"
              title="{{ link.title }}"
                        {% endif %}
            tabindex="-1"
              >
                    <div class="thumbnail-link__thumbnail"
                            {% if link.thumbnail.src or link.thumbnail.url %}
                            style="background-image: url('{{ resize_image_url(link.thumbnail.src or link.thumbnail.url or options.default_thumbnail, 400) }}');"
                            {% endif %}
                    ></div>
                </a>
            {% endif %}
            <div class="thumbnail-link__body">
                {% if link.title %}
        
      <h3 class="thumbnail-link__title h4">
        {% if options.show_date == true or options.show_category == true or options.show_all_category == true or options.show_author == true %}
        <em>
          {% if options.show_date == true %}
          {{ link.date | date: "%b %d, %Y" }} 
          {% if (link.categories or link.author) %}
          | 
          {% endif %}
          {% endif %}

          {% if options.show_category == true or options.show_all_category == true %}
          {% if link.categories %}
          {% for tag in link.categories %}
          {{ tag.name }}{% unless forloop.last %}, {% endunless %}
          {% endfor %}
          {% endif %}
          {% endif %}

          {% if options.show_author == true %}
          {% if link.author %}
          {% if options.show_date != true and not link.categories %}
          | 
          {% endif %}
          <a href="{{ link.author_url }}">{{ link.author }}</a>
          {% endif %}
          {% endif %}
        </em>
        {% endif %}
        {% if link.url %}<a href="{{ link.url }}">{{ link.title }}</a>{% endif %}
      </h3>



                {% endif %}
            </div>
        </div>
    </div>
{%- endmacro -%}

Anyone have a clue?

Upvotes: 0

Views: 24

Answers (0)

Related Questions