Jump to content

How to hide sections from certain URLs?

Recommended Posts

Hey folks. I just found out how to use code to hide particular sections from view in mobile, and this has been super helpful. What I'd like to do next might be a bit more complicated though... Can I use code to remove sections from a specific URL too? 

For example, with my Shop I'd like to make it so I have a categories section displayed for the storefront, but i'd like to remove them from the specific category pages (eg. my Charms, Prints sub-sections). Is there a way to do this? I would usually do a code injection into the header, but since it's the shop it technically doesn't have seperate pages... I've drawn up what i'm looking for incase that was confusing! 

I have the Squarespace IDs extension downloaded btw if that helps.

Many thanks!

Untitled_Artwork 10.png

Link to comment
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

2 hours ago, sabercosmos said:

Hey folks. I just found out how to use code to hide particular sections from view in mobile, and this has been super helpful. What I'd like to do next might be a bit more complicated though... Can I use code to remove sections from a specific URL too? 

For example, with my Shop I'd like to make it so I have a categories section displayed for the storefront, but i'd like to remove them from the specific category pages (eg. my Charms, Prints sub-sections). Is there a way to do this? I would usually do a code injection into the header, but since it's the shop it technically doesn't have seperate pages... I've drawn up what i'm looking for incase that was confusing! 

I have the Squarespace IDs extension downloaded btw if that helps.

Many thanks!

Untitled_Artwork 10.png

You can combine using media query Css and target the right section id you want to hide 

@media only screen and (max-width: 767px) {
  section-id {
    display: none;
  }
}

The extension to get right section id: Squarespace ID Finder

How to get section id:  https://recordit.co/Aj9vXw6rfY

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

If you still do not figure out, you can share your site with the protected password so we can take a look

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
1 hour ago, Beyondspace said:

You can combine using media query Css and target the right section id you want to hide 

Thanks! This works, but it hides the section from all the shop sections. Is there a way to reveal it only for one category? Also sorry my original post was a bit unclear- I'd like to do this for both desktop and mobile. 🙂

Website: https://www.sabercosmos.co.uk/

Pass: forum

The section i'd like to have the "Shop by Collection" section in is Shop > All, and i'd like to remove it from the rest (like Shop > Prints and etc)

Link to comment
On 11/14/2022 at 11:11 PM, sabercosmos said:

Thanks! This works, but it hides the section from all the shop sections. Is there a way to reveal it only for one category? Also sorry my original post was a bit unclear- I'd like to do this for both desktop and mobile. 🙂

Website: https://www.sabercosmos.co.uk/

Pass: forum

The section i'd like to have the "Shop by Collection" section in is Shop > All, and i'd like to remove it from the rest (like Shop > Prints and etc)

Do you still need help on this? Last week I helped a similar case for a member

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.