Jump to content

&amp problem

Recommended Posts

  • Replies 16
  • Views 1.8k
  • Created
  • Last Reply
7 minutes ago, Morten77 said:

Sorry i don't find the other one, I have tried to search.

Its works out well, after combining the two treads.

No worries.

I updated my code including the product grid and the breadcrumbs in the selector. That way you don't have to duplicate two virtually identical versions of the code in Page Header Code Injection.

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 12/9/2020 at 11:50 PM, creedon said:

Add the following to Store Settings > Advanced > Page Header Code Injection.


<script>

  $( ( ) => {
  
    $( '.grid-title, .ProductItem-nav-breadcrumb-link' ).each ( function ( ) {
    
      $this = $( this )
      
      let html = $this.html ( ).replace ( /&amp;amp;+/g, '&amp;' );
      
      $this.html ( html );
      
      } );
      
    } );
    
  </script>

This is very similar to an issue within another thread.

Let us know how it goes.

Following this thread. Having trouble removing this problem from our merch store: https://www.chriskingandthegutterballs.com/merch

Link to comment
54 minutes ago, ChrisKing said:

Following this thread. Having trouble removing this problem from our merch store

I'd be happy to try and extend my code to cover your use case but I'm not seeing any funky ampersands. Could you point me to a more specific page where the problem is occurring? Or did you replace your & with 'N'? If the later if you could have just one product with the & in it then I'd have something to work with.

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...
1 hour ago, creedon said:

@Morten77

I have updated the code in my previous code post.

I have used this one:

 

<script>

  $( ( ) => {
  
    $( '.grid-title, .ProductItem-nav-breadcrumb-link' ).each ( function ( ) {
    
      $this = $( this )
      
      let html = $this.html ( ).replace ( /&amp;amp;+/g, '&amp;' );
      
      $this.html ( html );
      
      } );
      
    } );
    
  </script>
Link to comment

Move the following...

from Settings > Advanced > Code Injection > FOOTER

to Settings > Advanced > Code Injection > HEADER

Don't replace the code in the HEADER, if any, just add to it.

<script src="https://code.jquery.com/jquery-3.4.1.js"></script>

The jQuery needs to load before any code that needs it does.

While I was diagnosing the issue I noticed shinyApp is spewing a continues stream of console.log messages. It makes tracking any issues very difficult and may have other undesired effects.

I don't have a solution but it wouldn't hurt to contact the developer to ask what is going on.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.