Back end logic issue

BC428
Member

Our blogs are having a back end logic issue. Any blogs that have been tagged only once using the correctly associated tag, will not populate when that tag is selected in our category module. It seems that as long as a blog has been tagged at least twice it will populate. 
The other issue is that tags associated with our Client Only Blog are showing up in the Prospect facing blog even though they are two separate blogs. The category module seems to populate from both blogs but we don't want it to. Can anyone help me address either of these issues? 

0 Upvotes
9 Replies 9
MuhammadAmjad
Participant

Hey @BC428, spotted the likely issue in your earlier post! This line: {% set all_tags = blog_tags('default') %} It's pulling tags from ALL blogs (using 'default'), not just the current one. Change it to: {% set all_tags = blog_tags(group.id) %} This should fix the cross-blog tag issue. For the single-tag problem, share that with your developer—might be a filter or limit in the Custom_Blog_Posts module logic causing it.


Did my answer help? Please click "Mark as solution" — it helps others and means a lot to me!

I use my real experience, community knowledge, and expert tools (including AI when needed) to give the most accurate and human responses.


amjad_khatri.jpg

Muhammad Amjad

Senior Consultant • HubSpot + Web Automation Expert

Need HubSpot Help? Send Me a DM


free-linkedin-icon-130-thumbConnect with me On LinkedIn 

Specialties:

  • HubSpot CRM Setup & Automation
  • Custom Workflows & Email Marketing
  • API Integrations & Webhooks
  • WordPress + Laravel Development


Available for consulting, troubleshooting & custom HubSpot solutions.

0 Upvotes
BC428
Member

This is the code I found in the Prospect facing blog that indicates possibly tags: 
{# <div class="growfast-blog__header">

<div class="growfast-blog__header__bg">
{% if theme.blog.header_background.src %}
<div class="growfast-blog__header__bg--image" style='background-image: url("{{ theme.blog.header_background.src }}");'></div>
{% endif %}
</div>
<div class="growfast-blog__header__content">

<div class="growfast-blog__header__content-inner">
<h1>{{ group.public_title }}</h1>
{% set blog_tags = blog_tags(group.id, 250) %}
{% if blog_tags %}
<div class="growfast-blog__header__content-inner--tags">
{% for tag in blog_tags %}
<a class="growfast-blog__header__content-inner--tag-link" href="{{ blog_tag_url(group.id, tag.slug) }}" rel="tag">{{ tag.name }}</a>
{% endfor %}
</div>
{% endif %}
</div>

</div>
</div> #}

 

And this is the code from the Client Only Blog: 
{# <div class="growfast-blog__header">

<div class="growfast-blog__header__bg">
{% if theme.blog.header_background.src %}
<div class="growfast-blog__header__bg--image" style='background-image: url("{{ theme.blog.header_background.src }}");'></div>
{% endif %}
</div>
<div class="growfast-blog__header__content">

<div class="growfast-blog__header__content-inner">
<h1>{{ group.public_title }}</h1>
{% set blog_tags = blog_tags(group.id, 250) %}
{% if blog_tags %}
<div class="growfast-blog__header__content-inner--tags">
{% for tag in blog_tags %}
<a class="growfast-blog__header__content-inner--tag-link" href="{{ blog_tag_url(group.id, tag.slug) }}" rel="tag">{{ tag.name }}</a>
{% endfor %}
</div>
{% endif %}
</div>

</div>
</div> #}

 

Does this help @BarryGrennan 

0 Upvotes
BarryGrennan
Key Advisor

@BC428 that looks to me like it's just for showing the title of the blog on the list page

<h1>{{ group.public_title }}</h1>

That shows the name of the blog in a h1 tag

and then listing the actual tags associated with that blog

{% set blog_tags = blog_tags(group.id, 250) %}
{% if blog_tags %}
<div class="growfast-blog__header__content-inner--tags">
{% for tag in blog_tags %}
<a class="growfast-blog__header__content-inner--tag-link" href="{{ blog_tag_url(group.id, tag.slug) }}" rel="tag">{{ tag.name }}</a>
{% endfor %}
</div>
{% endif %}


Those would be a list of the tags, not the posts themselves. And using group.id would mean it only show tags used in the specific blog you're on.

If you're sure that there's two seperate blogs, make sure that the tags aren't used in the Prospect facing blog. If you click on the link for the tags that are showing in error, what posts does it show you?


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

 

0 Upvotes
BC428
Member

We do have two separate blogs. if I click on the tag link where the error seems to be it does not populate the blog that has been tagged (but only when the tag is used once). If that tag is used at least two times in different blogs then it populates below the category module as it's supposed to. 

I was able to find this though and I think this is possibly where the error is. 
{% set all_tags = blog_tags('default') %}
<div class="blog-tags">

{% for tag in all_tags %}


{% if tag.name == 'Private'%}
{% continue %}
{% endif %}
<a href="{{ blog_tag_url(group.id, tag.slug) }}" class="blog-tag-link {% if tag.slug in current_url %} active{% endif %}">
{{ tag.name }}
</a>
{% endfor %}
</div> 

__________________________________________________

This is the Temlate usage snippet too if that's helpful:
{% module "module_17623746101081" path="/GrowFast_Free_Theme_child/modules/Custom_Blog_Posts", label="Custom_Blog_Posts" %}
________________________________________________________

And these are the errors that are popping up: 

BC428_3-1762376129893.png

We used Insidea as a custom developer and they created the blog page so I'm wondering if they made a mistake so it's not communicating from the back end to the front end clearly. 

 

I am obviously NOT a developer 😂. So if none of this makes sense just say! 

0 Upvotes
BarryGrennan
Key Advisor

Hi @BC428

 

Apologies for the delay, been dealing with family medical issues the last number of days.

 

My guess now would be that the issue is within the Custom_Blog_Posts module itself if that's what's being used to display the posts.

 

Honestly though, I don't think posting code snippets that may or may not be related to the issue will get you closer to resolving it.

 

I'd suggest you either go back to the developer to resolve the issue or hire a new developer to solve it.

 


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

 

0 Upvotes
BC428
Member

Hi Barry, thank you so much for getting back to me and I am sorry to hear that your family is dealing with medical issues, that can be scary. I hope everyone is okay! I agree, the code snippets won't get me closer to resolving the issue and it probably is time to hire a developer. Thank you for pointing me towards the Custom_Blog_Posts module, I think this could be correct. Kind regards, Bre

0 Upvotes
Jaycee_Lewis
Thought Leader

Thank you for all the help @BarryGrennan 🧡 — Jaycee





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




BarryGrennan
Key Advisor

@BC428 can you post the code from your category module. People are likely going to struggle to help you otherwise.

 


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

0 Upvotes
BC428
Member

Hello Barry, I wasn't sure if you saw the last message I posted? Is that code helpful for being able to identify the issue?