Blog - Group content

SOLVE
Philip_Marsh
Contributor

Hi,

 

I'm trying to think about how I could approach this. I'm designing a new blog but I'm stumped on Grouping.

 

The issue I'm facing is that I can group content based on tags, and authors. Is there any way to group content further? to create multiple ways to group content

 

The idea is to have a series of articles grouped together. For example, "Day in the life of Steve" Series 1, "Day in the life of Brian" Series 2, and "Day in the life of Barry" Series 3. Clicking onto this takes you to a subcategory highlighting each article within that series

The reason I can't use tags is that tags will already be used to group those series. So Series 1 and 3 could be under 1 tag, while series 2 would be under another. 

 

Back end, this can be done using Campaign, but I'm not sure if you can use that to display them front of the website?

 

OR am I best-creating something custom using HubDB and Hubl?

0 Upvotes
2 Accepted solutions

Accepted Solutions
Gonzalo
Solution
Top Contributor

You can go HubDB if you want to.
Although, I believe the fastest way is probably using a trick to "hide" topics/tags from the "normal" listing.

For example:

You say you are already using the tags to organize by series. So what you will need to do to create "subtags" would be to apply a custom format that will allow you later to hide from the main listing.

What I usually do is prefix all the subtopics (or hidden topics) with "_"
You will end up with a topic list like:
Main-serie

_sub-serie

 

Then in your blog template, you can filter out whenever you are displaying the list of topics to something like this:

{% for topic in content.topic_list %} 
  {% if not topic is string_startingwith "_" %}
    {# Display here your tag #}
    ....
  {% endif %}
{% endfor %}

This way you can keep some subtopics independently from the "main tags" (or series in your case). But keeping the default listing functionality provided by Hubspot, as you will have access to the topic page like url.com/blog/tag/_subtopic

View solution in original post

Gonzalo
Solution
Top Contributor

Hi @Philip_Marsh ,

Sorry but, I dont fully understand what you mean with

 

(eng is not my main lang 🙂 )

Anyway, I believe the general idea is to keep it "hidden" from the frontend which is actually a valid thing I often do too.

For that you will only need to cut the first char of the string name when displaying the tag name (whereever you are doing it, so double check all the places!).
Common places to cut the it from:

Listings pages:

- Blog header (when in topic/tag listing)

- Maybe sidebar (in all listing pages)

 

- Post page:

- Topic/tag list in post page.

- Sidebar?

 

To keep a clean name in the frontend, when displaying the topic name you will want to do something like:

{{ topic.name|replace("_", "") }}

This method actually doesn't require to use the underscore, if you want to be safe you could use a more uncommon symbol for your client or concatenate twice like __ if you want to use normal underscore somewhere else.

The only place that will be visible is the slug of the URL, but that should be more than fine I believe.

 

As you can imagine this method is pretty easier to expand, like you could potentially create several levels of tags, or even combine different listings as categories (if contains your special char.) and normal tags for the common etc. 

 

For extra documentation, you can check all the available filter you can apply to strings here:

 

 

 

View solution in original post

6 Replies 6
dennisedson
Community Manager

Hello @Philip_Marsh !

This is a great question, I am going to throw some people into this to see how people are doing this.

@stefen , @ChadP , @Gonzalo , @BootstrapC  -- how are you all approaching this?

Thanks,

Dennis



Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
stefen
Key Advisor | Partner

@Philip_Marsh @dennisedson I've done a similar thing a while back by creating a blog for each one and then making a custom page template to combine them all into one. So the main blog page was actually just a website page that listed posts from each of the blogs.

Stefen Phelps, Community Champion, Kelp Web Developer
Gonzalo
Solution
Top Contributor

You can go HubDB if you want to.
Although, I believe the fastest way is probably using a trick to "hide" topics/tags from the "normal" listing.

For example:

You say you are already using the tags to organize by series. So what you will need to do to create "subtags" would be to apply a custom format that will allow you later to hide from the main listing.

What I usually do is prefix all the subtopics (or hidden topics) with "_"
You will end up with a topic list like:
Main-serie

_sub-serie

 

Then in your blog template, you can filter out whenever you are displaying the list of topics to something like this:

{% for topic in content.topic_list %} 
  {% if not topic is string_startingwith "_" %}
    {# Display here your tag #}
    ....
  {% endif %}
{% endfor %}

This way you can keep some subtopics independently from the "main tags" (or series in your case). But keeping the default listing functionality provided by Hubspot, as you will have access to the topic page like url.com/blog/tag/_subtopic

View solution in original post

Philip_Marsh
Contributor

Thank you, I have 2 follow up questions because there are 2 ways I can implement that method.

 

If I use that at the start, is there a way to use truncate to cut it To my knowledge, it only works at the end and works backwards.

 

Alternatively, if I add the _ at the end of the tag, is string_endingwith a valid function?

 

If so, using the blog will save me so much build time. 

0 Upvotes
Gonzalo
Solution
Top Contributor

Hi @Philip_Marsh ,

Sorry but, I dont fully understand what you mean with

 

(eng is not my main lang 🙂 )

Anyway, I believe the general idea is to keep it "hidden" from the frontend which is actually a valid thing I often do too.

For that you will only need to cut the first char of the string name when displaying the tag name (whereever you are doing it, so double check all the places!).
Common places to cut the it from:

Listings pages:

- Blog header (when in topic/tag listing)

- Maybe sidebar (in all listing pages)

 

- Post page:

- Topic/tag list in post page.

- Sidebar?

 

To keep a clean name in the frontend, when displaying the topic name you will want to do something like:

{{ topic.name|replace("_", "") }}

This method actually doesn't require to use the underscore, if you want to be safe you could use a more uncommon symbol for your client or concatenate twice like __ if you want to use normal underscore somewhere else.

The only place that will be visible is the slug of the URL, but that should be more than fine I believe.

 

As you can imagine this method is pretty easier to expand, like you could potentially create several levels of tags, or even combine different listings as categories (if contains your special char.) and normal tags for the common etc. 

 

For extra documentation, you can check all the available filter you can apply to strings here:

 

 

 

View solution in original post

Philip_Marsh
Contributor

That's brilliant. I think this pretty much answers everything I have on this topic. 

 

I don't know why I didn't think of the Replace command. Early morning brain. 

 

Thank you