Jump to content

Combining Anchor Links with Categories

Recommended Posts

  • Replies 6
  • Views 2.4k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 9 months later...
Posted (edited)
On 10/23/2023 at 8:21 PM, tuanphan said:

Can you share link to page where you use category? We can check/test code easier

Hello tuanphan-

I am trying to achieve a similar thing described by jholmertz. I have set up a blog page where the posts are preceded by other sections of content. I introduce the blog posts (there are only four in total right now, for testing) with buttons for specific post categories. Because the blog posts are so far down the page, when someone clicks on a specific category, I want the page to refresh to where the blog posts are rather than popping the user to to top of the page. Therefore, I set up an anchor link [https://www.radiantrosehealing.com/blog/#blog-cats] just above that region and have combined the anchor link with the category link [https://www.radiantrosehealing.com/blog?category=Resources/#blog-cats]. For me, at least, the anchor aspect works perfectly—the page refreshes to the blog posts region. The category aspect, however, does not—no posts get loaded! Can you see what I'm missing? [The password to that currently hidden page is "NorthStar".]

Edited by LoriH
Clarification
  • 3 months later...
Posted
On 7/30/2024 at 4:08 AM, LoriH said:

Hello tuanphan-

I am trying to achieve a similar thing described by jholmertz. I have set up a blog page where the posts are preceded by other sections of content. I introduce the blog posts (there are only four in total right now, for testing) with buttons for specific post categories. Because the blog posts are so far down the page, when someone clicks on a specific category, I want the page to refresh to where the blog posts are rather than popping the user to to top of the page. Therefore, I set up an anchor link [https://www.radiantrosehealing.com/blog/#blog-cats] just above that region and have combined the anchor link with the category link [https://www.radiantrosehealing.com/blog?category=Resources/#blog-cats]. For me, at least, the anchor aspect works perfectly—the page refreshes to the blog posts region. The category aspect, however, does not—no posts get loaded! Can you see what I'm missing? [The password to that currently hidden page is "NorthStar".]

I think the browser can't read the url blog?category=Resources/#blog-cats

I guess we can use script code to set click behavior for this case.

Can you provide correct password?

image.png.c27804db47b90b614ddf7fa378796e71.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.