CMS Development

henryd1
Member

Modify URL of blog_page_link function

SOLVE

Hi guys,

 

does anybody know how to modify the output URL of the blog_page_link function; to be precise, adding an URL extension? 

 

My blog listing section is not at the top of the website but it obviously jumps back to the top when I, for instance, move on to the next page, last page, etc. 

 

Since this function is used in the href attribute, I figured that I could jump to the desired section by adding the div id in the URL. 

 

Would appreciate any ideas. 🙂

 

Cheers,

-Henry

0 Upvotes
1 Accepted solution
lscanlan
Solution
HubSpot Alumni
HubSpot Alumni

Modify URL of blog_page_link function

SOLVE

Hi @henryd1,

 

I see no reason why adding the ID as a hash in the href attribute wouldn't work. That's what I'd suggest doing. So you'd have something like:

 

<a href="{{ blog_page_link(next_page_num) }}#blog-listing-section">Next</a>

If that's not working, could you link me to your blog? I'm sure we can get it figured out.

 

Leland Scanlan

HubSpot Developer Support

View solution in original post

0 Upvotes
2 Replies 2
lscanlan
Solution
HubSpot Alumni
HubSpot Alumni

Modify URL of blog_page_link function

SOLVE

Hi @henryd1,

 

I see no reason why adding the ID as a hash in the href attribute wouldn't work. That's what I'd suggest doing. So you'd have something like:

 

<a href="{{ blog_page_link(next_page_num) }}#blog-listing-section">Next</a>

If that's not working, could you link me to your blog? I'm sure we can get it figured out.

 

Leland Scanlan

HubSpot Developer Support
0 Upvotes
henryd1
Member

Modify URL of blog_page_link function

SOLVE

Hi @lscanlan

 

 

 

Thanks to your response I was able to find the culprit  forgot to add the id attribute to the blog listingmark up itself (silly me).

 

Many thanks again for your help, Leland!

 

Cheers,

0 Upvotes