Jump to content

Adding Category Descriptions by Category Page

Recommended Posts

@creedon Hi there,

I'd also like to add brief text descriptions for individual product category pages

https://www.larasingsvintage.com

PW: successfulbusiness

I've downloaded this code and followed the instructions to the best of my ability.  I created a not-linked Link page, uploaded the file to it and injected the code into the header as instructed.

Then I placed this code into the store header page with the text I'd hoped to include 

'sets' : 'Sets cannot be broken up, they are rentable together only'

Could you please let me know what I did wrong? Apologies if it's something obvious. 

Thanks very much for the help! 

Edited by LaraSingsVintage
Link to comment
1 hour ago, LaraSingsVintage said:

Could you please let me know what I did wrong? Apologies if it's something obvious.

You did nothing wrong. I need to make a small change either to the instructions or to the code to make things easier for folks.

In the meantime change the following...

'sets' : 'Sets cannot be broken up, they are rentable together only'

...to...

'/sets' : 'Sets cannot be broken up, they are rentable together only'

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

I have updated my code cited in my May 6, 2021 post.

From the changes.

make code for urlSlugs work the way the text describes to enter them. also be flexible with either starting with a forward slash or not

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 3 weeks later...
19 hours ago, shishkabobbett said:

is it possible to edit part of the code to have the description added after the product listings on the category pages instead of before?

I don't have a solution but I have updated my code cited in my May 6, 2021 post to make it possible to place the description in other locations than the top. One would have to change the settings to accomplish whatever placement scenario you want.

From the changes.

make code more flexible in where the description can be placed

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 6/16/2023 at 4:29 PM, creedon said:

I don't have a solution but I have updated my code cited in my May 6, 2021 post to make it possible to place the description in other locations than the top. One would have to change the settings to accomplish whatever placement scenario you want.

From the changes.

make code more flexible in where the description can be placed

@creedon So the new code isn't working at all for me, even without editing the the placement settings.  I had to go back to the previous edition to get it to work.  Any thoughts on what I'm doing wrong?

Edited by shishkabobbett
Link to comment
37 minutes ago, shishkabobbett said:

So the new code isn't working at all for me, even without editing the the placement settings.  I had to go back to the previous edition to get it to work.  Any thoughts on what I'm doing wrong?

When I install the code here locally on your site, it works.

ScreenShot2023-06-20at2_26_34PM.thumb.png.d6148f82223cbad2aeeb99241aaf6a3f.png

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
10 hours ago, hglondon said:

do you know if there will be any SEO benefit?

I do not know.

Given that it is JavaScript there is no way to guarantee that a search engine will pick up the information. Some engines run some JavaScript, some don't.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 1 month later...
8 hours ago, hglondon said:

is there any way to add links to the description?

Yes. You can use HTML in the descriptions.

<a href="[enter your link here between single quotes replacing square brackets]">[enter your text here between single quotes replacing square brackets]</a>

Quote

How do I get this to work for subcategories, e.g. Jackets/Cotton?

Please post the URL for a page on your site where we can see your issue.

A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

We can then take a look at your issue.

You may find How to post a forum question post useful.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 3 weeks later...

I have updated my cited code in my May 6, 2021 post.

From the changes.

  • reworked the parsing code to be a bit more flexible
  • fix disparity between how the read me said to configure category list and how the code works

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
14 hours ago, hglondon said:

Unfortunately, the description no longer supports links.

 

Quote

The nested category description also doesn't break to the next line

Thank you for hanging in and the reports. Obviously the 0.7.x release was/is a little rougher that I would have liked but I think I'm making progress.

Please get the latest release and replace the code you have installed. You should be able to leave the <x-twc-splcda> code in place.

I have updated my cited code in my May 6, 2021 post.

From the changes

  • fix parsing errors including description html not coming through

Let me know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

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.