• Help Desk reporting gives you real-time visibility into your support operation without the manual work. Ask our experts about which metrics matter most! AMA Dec 8-12.

    Ask us anything

Add blog tags to category options

hjender
Participant

On the blog home page, I'd like the tags on blog articles to show as categories that you can choose to sort the articles.

 

Where can I update the categories for the blog?tags vs categories.png

1 Accepted solution
TRooInbound
Solution
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Hi @hjender,

 

Nice to see you again after solving your video sorting issue! let's solve this again. 

 

You can use HubL and Javascript code to show blog articles tags as categories in drop down, for that you need Custom HubL in your page.

 

To add Custom HubL in your page you need to drag and drop Custom HubL from left side bar from design manager to your page. After adding Custom HubL you need to paste below code and your work done.

<div style="display:none">
  {% set my_topics = blog_topics('your-blog-id', 250) %}
  <ul class="reqData">
    {% for item in my_topics %}
      <li><a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item }}</a></li>
    {% endfor %}
  </ul>
</div>

<script>

$('#hs_menu_wrapper_blog_categories_menu ul').empty();
$('.reqData li').each(function(){
  $('#hs_menu_wrapper_blog_categories_menu ul').append('<li class="hs-menu-item hs-menu-depth-1">' +  $(this).html() + '</li>');
});
</script>

 

Note: You can select your blog from: Content > Blog > Select your particular blog from dropdown, Below is attached screenshot where blog ID is highlighted from where you got your blog id and replace to code where you found 'your-blog-id'

Capture.PNG

 

 

We hope it works for you.

Team TRooInbound!

View solution in original post

0 Upvotes
1 Reply 1
TRooInbound
Solution
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Hi @hjender,

 

Nice to see you again after solving your video sorting issue! let's solve this again. 

 

You can use HubL and Javascript code to show blog articles tags as categories in drop down, for that you need Custom HubL in your page.

 

To add Custom HubL in your page you need to drag and drop Custom HubL from left side bar from design manager to your page. After adding Custom HubL you need to paste below code and your work done.

<div style="display:none">
  {% set my_topics = blog_topics('your-blog-id', 250) %}
  <ul class="reqData">
    {% for item in my_topics %}
      <li><a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item }}</a></li>
    {% endfor %}
  </ul>
</div>

<script>

$('#hs_menu_wrapper_blog_categories_menu ul').empty();
$('.reqData li').each(function(){
  $('#hs_menu_wrapper_blog_categories_menu ul').append('<li class="hs-menu-item hs-menu-depth-1">' +  $(this).html() + '</li>');
});
</script>

 

Note: You can select your blog from: Content > Blog > Select your particular blog from dropdown, Below is attached screenshot where blog ID is highlighted from where you got your blog id and replace to code where you found 'your-blog-id'

Capture.PNG

 

 

We hope it works for you.

Team TRooInbound!

0 Upvotes