Jump to content

PrismaVisual

Member
  • Posts

    14
  • Joined

  • Last visited

Everything posted by PrismaVisual

  1. This worked perfectly!!! It works on all instance: store pages, the summaries, the maps...everywhere! I am beyond grateful. Thank you so much! Can I buy you a coffee?
  2. @creedon Thanks so much for the reply! I tried adding that where specified but the entire page content disappeared and showed as "/undefined" up in the address bar. I'm way over my head here lol...it is my first time messing with javascript. Am I supposed to modify that somehow? I am adding properties/neighborhoods as "products" in "store pages" so that I can use them in conjunction with advanced map blocks plugin and universal filter from squarewesbites. These both work beautifully but then I realized that every instance of a product automatically links to the built in pages. 🤦🏻‍♀️ And of course I had already created all custom 40 property pages and 28 neighborhood pages. 🤡😩 I just need a way to change those links!! I figured javascript would be the quickest solution. I thought either having a script that would omit the "/rentals/p" part from the urls, placed in the sitewide header injection would be best. Or even a script to redirect the urls would be amazing. I got close but could only make it work for 1/40 of them. 🤣
  3. Hello, I'm hoping someone can point me in the right direction here. I've been messing around with 2 different approaches but haven't been able to work it out (it's been dayyyyysss 😑). I know I'm doing something(s) wrong..I just don't know what I don't know yet! 😅 I'm trying to implement some javascript on my store page so I can redirect the product links. I want to redirect product urls like: https://mayellre.squarespace.com/rentals/p/130-water-street to urls like: https://mayellre.squarespace.com/130-water-street. There are currently 40 rental "products" (more to come eventually), but they will never be able to be added to a cart/purchased. I assume that may be why the below doesn't work. <script> window.customCartDrawer = { onUpdateFunction: function(drawer, data) { $(document).ready(function(){ $('a').each(function(){ this.href = this.href.replace('/rentals/p/', '/'); }); } } </script> This is the other option I tried. I was able to get this to work for one redirect, however when I tried to implement it for all 40 product links, it only redirects 1 of them. Maybe im targeting them or separating wrong? Single var set: <script> var fromUrl = '/rentals/p/1-west-street-listing'; var toUrl = '/1-west-street'; // do not edit below this line var fromRegex = "^\\" + fromUrl + "\\/?$"; var match = location.pathname.match(new RegExp(fromRegex, 'i')); if (match && !window.frameElement) { window.location.replace(toUrl); } </script> My best guess at multiple var (not working) 😕 <script> var fromUrl = '/rentals/p/1-west-street-listing'; var toUrl = '/1-west-street'; var fromUrl = '/rentals/p/2-gold-street-listing'; var toUrl = '/2-gold-street'; var fromUrl = '/rentals/p/2-water-street-listing'; var toUrl = '/2-water-street'; var fromUrl = '/rentals/p/8-spruce-street-listing'; var toUrl = '/8-spruce-street'; var fromUrl = '/rentals/p/10-barclay-street-listing'; var toUrl = '/10-barclay-street'; var fromUrl = '/rentals/p/10-liberty-street-listing'; var toUrl = '/10-liberty-street'; var fromUrl = '/rentals/p/15-broad-street-listing'; var toUrl = '/15-broad-street'; var fromUrl = '/rentals/p/15-cliff-street-listing'; var toUrl = '/15-cliff-street'; var fromUrl = '/rentals/p/15-park-row-listing'; var toUrl = '/15-park-row'; var fromUrl = '/rentals/p/15-william-street-listing'; var toUrl = '/15-william-street'; var fromUrl = '/rentals/p/19-dutch-street-listing'; var toUrl = '/19-dutch-street'; var fromUrl = '/rentals/p/20-exchange-place-listing'; var toUrl = '/20-exchange-place'; var fromUrl = '/rentals/p/20-pine-street-listing'; var toUrl = '/20-pine-street'; var fromUrl = '/rentals/p/20-west-street-listing'; var toUrl = '/20-west-street'; var fromUrl = '/rentals/p/21-west-street-listing'; var toUrl = '/21-west-street'; var fromUrl = '/rentals/p/21-23-south-william-street-listing'; var toUrl = '/21-23-south-william-street'; var fromUrl = '/rentals/p/30-park-place-listing'; var toUrl = '/30-park-place'; var fromUrl = '/rentals/p/37-wall-street-listing'; var toUrl = '/37-wall-street'; var fromUrl = '/rentals/p/40-broad-street-listing'; var toUrl = '/40-broad-street'; var fromUrl = '/rentals/p/40-broad-street-listing'; var toUrl = '/40-broad-street'; var fromUrl = '/rentals/p/45-wall-street-listing'; var toUrl = '/45-wall-street'; var fromUrl = '/rentals/p/50-west-street-listing'; var toUrl = '/50-west-street'; var fromUrl = '/rentals/p/55-liberty-street-listing'; var toUrl = '/55-liberty-street'; var fromUrl = '/rentals/p/55-wall-street-listing'; var toUrl = '/55-wall-street'; var fromUrl = '/rentals/p/63-wall-street-listing'; var toUrl = '/63-wall-street'; var fromUrl = '/rentals/p/67-wall-street-listing'; var toUrl = '/67-wall-street'; var fromUrl = '/rentals/p/70-pine-street-listing'; var toUrl = '/70-pine-street'; var fromUrl = '/rentals/p/71-broadway-listing'; var toUrl = '/71-broadway'; var fromUrl = '/rentals/p/75-wall-street-listing'; var toUrl = '/75-wall-street'; var fromUrl = '/rentals/p/80-john-street-listing'; var toUrl = '/80-john-street'; var fromUrl = '/rentals/p/85-john-street-listing'; var toUrl = '/85-john-street'; var fromUrl = '/rentals/p/88-greenwich-street-listing'; var toUrl = '/88-greenwich-street'; var fromUrl = '/rentals/p/90-west-street-listing'; var toUrl = '/90-west-street'; var fromUrl = '/rentals/p/90-william-street-listing'; var toUrl = '/90-william-street'; var fromUrl = '/rentals/p/95-wall-street-listing'; var toUrl = '/95-wall-street'; var fromUrl = '/rentals/p/100-barclay-street-listing'; var toUrl = '/100-barclay-street'; var fromUrl = '/rentals/p/110-greenwich-street-listing'; var toUrl = '/110-greenwich-street'; var fromUrl = '/rentals/p/114-liberty-street-listing'; var toUrl = '/114-liberty-street'; var fromUrl = '/rentals/p/123-washington-street-listing'; var toUrl = '/123-washington-street'; var fromUrl = '/rentals/p/130-water-street-listing'; var toUrl = '/130-water-street'; var fromUrl = '/rentals/p/180-water-street-listing'; var toUrl = '/180-water-street'; // do not edit below this line var fromRegex = "^\\" + fromUrl + "\\/?$"; var match = location.pathname.match(new RegExp(fromRegex, 'i')); if (match && !window.frameElement) { window.location.replace(toUrl); } </script>
  4. Site URL: https://mayellre.squarespace.com/about Hello forum peeps ! Does anyone know of a way I can customize a gallery lightbox action using css (or any other way)? What I would like to happen is that when an image in the gallery is clicked, instead of showing that same photo in the lightbox, I'd like it to show a different photo. I've attached a screenshot for example. Note the text in the "new image" shown in the screenshot will be part of the image. Unless of course, you know how I can keep it live! 😄 the access password is: bennythejet
×
×
  • 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.