CMS Development

FedGo
Participant

Different template for TAG pages

SOLVE

Hello there,

im actually work on some template for ur costumer, i edit the listening blog template for homepage, and a different template for single post.

Now i found, when i click on TAG pages that the template is like the main blog template. 

I wish edit some row, or delete some rows, how i can edit a different template and assign to TAG pages? 

Or.. if is possible, can add som css only for TAG Pages?

Thanks.

0 Upvotes
1 Accepted solution
Jsum
Solution
Key Advisor

Different template for TAG pages

SOLVE

@FedGo,

 

Your question is a bit rough so let me know if I am off track with my answer.

 

You seam to be referencing 4 "templates" here:

 

home page - The home page for a website

blog listing page - the "home" page for your blog

blog post page - the template used to display individual posts

topic page - ???

 

Are you trying to use your blog listing page as your home page? I am guessing you are a WordPress developer, yes?

 

WordPress is natively a blogging platform so the home.php template is expected to be a the front of your website unless you express otherwise. 

 

Hubspot doesn't work this way. I don't think Hubspot has any predictions about what your home page should be. I haven't done this, but I would imagine that as long as your root domain "/" isn't taken you could simply assign this as your blog url in content settings -> blog settings.

 

If by home page you are actually refering to the listing page for your blog then I can definitely help you. 

 

In your blog template, in the blog content module, you will find a button that says "edit listing template". A code editor opens when you click it. 

 

In the code editor you will find an if statement with an else condition that wraps most of your listing page code, it looks like this (gutted):

{% if not simple_list_page %}
                                
{% else %}
    <h2 class="post-listing-simple"><a href="{{content.absolute_url}}">{{ content.name }}</a></h2>{% endif %}

What you are referring to as the topic (or "tag") page is actually the simple list page.  This page is where your blogs are display when filtered by topic, date, etc. By default the markup in your template is set to display an <h2> wrapping an <a> for each blog when displaying on a simple list page.

If this is your issue than you have 2 options:

 

1. change the markup in the else statement. You can put whatever mark up you want here so do what you would like with it.

 

2. If you do not want a difference between you main list page and a filtered list page just remove this if statement and everything in the else statement. Then your main blog markup will be used regardless of how you are viewing the list page.

 

Does this help at all?

View solution in original post

3 Replies 3
Jsum
Solution
Key Advisor

Different template for TAG pages

SOLVE

@FedGo,

 

Your question is a bit rough so let me know if I am off track with my answer.

 

You seam to be referencing 4 "templates" here:

 

home page - The home page for a website

blog listing page - the "home" page for your blog

blog post page - the template used to display individual posts

topic page - ???

 

Are you trying to use your blog listing page as your home page? I am guessing you are a WordPress developer, yes?

 

WordPress is natively a blogging platform so the home.php template is expected to be a the front of your website unless you express otherwise. 

 

Hubspot doesn't work this way. I don't think Hubspot has any predictions about what your home page should be. I haven't done this, but I would imagine that as long as your root domain "/" isn't taken you could simply assign this as your blog url in content settings -> blog settings.

 

If by home page you are actually refering to the listing page for your blog then I can definitely help you. 

 

In your blog template, in the blog content module, you will find a button that says "edit listing template". A code editor opens when you click it. 

 

In the code editor you will find an if statement with an else condition that wraps most of your listing page code, it looks like this (gutted):

{% if not simple_list_page %}
                                
{% else %}
    <h2 class="post-listing-simple"><a href="{{content.absolute_url}}">{{ content.name }}</a></h2>{% endif %}

What you are referring to as the topic (or "tag") page is actually the simple list page.  This page is where your blogs are display when filtered by topic, date, etc. By default the markup in your template is set to display an <h2> wrapping an <a> for each blog when displaying on a simple list page.

If this is your issue than you have 2 options:

 

1. change the markup in the else statement. You can put whatever mark up you want here so do what you would like with it.

 

2. If you do not want a difference between you main list page and a filtered list page just remove this if statement and everything in the else statement. Then your main blog markup will be used regardless of how you are viewing the list page.

 

Does this help at all?

FedGo
Participant

Different template for TAG pages

SOLVE

Hello there, thanks for the information. 

For complete reply i have 3 template:

1- Listening page = Blog homepage
2- Single blog page

3- Tag pages, that page i wish to be different from the blog homepage, a simple listening page. 

After your help and help from Hubspot Develper i figure it out and the it works.

 

Thank you! 

Federico.

SamiSharaf
Participant

Different template for TAG pages

SOLVE

Hi,

 

Did you find a solution to this? How did you do it?

 

I am having the same issue and looking for a way to customize the style of individual filtered pages eg. ...tag/filter1 to look different than ...tag/filter2

 

Any help would be greatly appreciated.