Jump to content

Customise Service Section

Recommended Posts

  • Replies 11
  • Views 687
  • Created
  • Last Reply

Top Posters In This Topic

#1. It looks like you changed layout on mobile?

#2. Add this to Last Line in Settings > Advanced > Code Injection > Footer

<!-- Code by @creedon - I don't remember which post I copied it from -->
<script>

  $( ( ) => {
  
    const selector = '.user-items-list-simple .list-item';
    
    $( selector ).each ( function ( ) {
    
      const $this = $( this );
      
      $( $this ).click ( function ( ) {
      
      const url = $( '.list-item-content__button', $this )
      
        .attr ( 'href' );
        
      $( `<a href="${ url }" target="_blank">` )
      
      	.get ( 0 )
        
        .click ( );
        
      } );
      
    } );
    
  } );
  
  </script>
<style>
  .user-items-list-item-container[data-section-id="632adf148c4a9956d83ff637"] .list-item-media {
    cursor: pointer;
}
</style>

 

Edited by tuanphan

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!)

Link to comment

Thank you very much 😃 👍 

Out of curiosity is it also possible to just have the image as the link, and not the text/beige box area?

Is there also a way I can adjust the padding/margin etc. on the text area so it moves in from the sides?

Edit: I can see that it's possible by editing the code, so I wondered is there a way I can apply this in the Code Injection etc?

image.thumb.png.626d736e9a96ba1b03a8b1fb04d11f5a.png

Edited by cube
Added more information
Link to comment
On 10/24/2022 at 8:51 PM, cube said:

Thank you again 😃 👍 

The text now looks great.

I was wondering if you think there would be a solution so the image (and the button) for each product are the only parts that contain the link?

What do you mean, or you mean this? "Out of curiosity is it also possible to just have the image as the link, and not the text/beige box area?"

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!)

Link to comment
On 10/26/2022 at 2:08 AM, tuanphan said:

What do you mean, or you mean this? "Out of curiosity is it also possible to just have the image as the link, and not the text/beige box area?"

Yes, so the Image and the button are the only links in the product boxes.
image.png.35c59ebc1f01c042707dcbedea6e843b.png

Link to comment
On 10/27/2022 at 4:15 PM, cube said:

Yes, so the Image and the button are the only links in the product boxes.
image.png.35c59ebc1f01c042707dcbedea6e843b.png

Try this new code

<script>

  $( ( ) => {
  
    const selector = '.user-items-list-simple .list-item';
    
    $( selector ).each ( function ( ) {
    
      const click1 = $('.list-item-media');
      
      $( click1 ).click ( function ( ) {
      
      const url = $( '.list-item-content__button', $this )
      
        .attr ( 'href' );
        
      $( `<a href="${ url }" target="_blank">` )
      
      	.get ( 0 )
        
        .click ( );
        
      } );
      
    } );
    
  } );
  
  </script>
<style>
  .user-items-list-item-container[data-section-id="632adf148c4a9956d83ff637"] .list-item-media {
    cursor: pointer;
}
</style>

 

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!)

Link to comment
On 11/1/2022 at 4:36 PM, cube said:

Thank you, unfortunately the link on the images does not lead to the product page now.

image.png

If that code doesn't work, I don't know how. You try posting this to Code & Customization box. Maybe someone can help.

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!)

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.