Jump to content

Read more toggle for long summary (reviews)

Recommended Posts

  • 2 weeks later...

You would need something like readmore.js and then could write some javascript for it.

Work With Me 🖥️💻📱

Please remember to tag me so that I get a notification and respond to your help requests.

If my answers have helped you, please drop a like and mark my answer as best to help other users find solutions quickly.

You can also thank me or make requests by buying me a coffee . (Caffeine fuels me to take more requests)

For Squarespace Tips & Tricks, visit @squareskills (Youtube 📺 Tutorials)

For Premium and FREE plugins, visit Squareskills (Plugin Store) 🧩

For Custom Plugins email me 🧩

Link to comment
  • 2 weeks later...
On 9/29/2021 at 12:07 AM, 895 said:

Do you know any lead or guide about how to do this?

or

Did anyone already look for this before?

Thanks!

Do you still need help?

If yes, can you duplicate the site & add me as a contributor? I can try testing some code

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

I use readmore.js for a customer on other projects, hope this steps will help you

https://sphinx.squarespace.com/founder

- Include jquery and readmore.js as dependencies 

- In Excerpt editor, add a link named 'read more' and place the href as '#read-more'

- In my implementation, the readmore belong to a normal text block, so it slightly different, but here how I place the code

<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/readmore.js@2.0.4/readmore.min.js"></script>
<script>
$(document).ready(function() {
	if (window.self!==window.top) {
		return;
	}
	// Issue 02
	$("[href='#read-more']").each(function(i, el) {
	    // First calculate the initial space between the content and the readmore tag   
	    const contentEl = $(el).closest(".html-block .sqs-block-content, .summary-excerpt");
      	if (contentEl.length == 0) { return false; }
	    const elBound = (el.getBoundingClientRect());
	    const contentBound = (contentEl[0].getBoundingClientRect());
	    contentEl.readmore({ 
	        collapsedHeight: elBound.y - contentBound.y,
	        speed: 500,
	        embedCSS: true, 
	        lessLink: '<a href="#" data-action="collapse-rmjs">Read less</a>'
	    })
	});
});
</script>

<style>
/* Tweak readmore js to hide the placeholder link */
[id*=rmjs] {
	transition: height 200ms;
    overflow: hidden;
}
[id*=rmjs] [href='#read-more'] {
	display: none;
}
body.sqs-edit-mode [href='#read-more'] {
	display: inline-block !important;	
}
</style>

image.png.ec975e20b6d74ac208f1c3c2d7b263ac.png

image.thumb.png.b3e87589cd1082d907b292cfb736f62a.png

Edited by bangank36

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace
🚀 Learn how to rank new pages on Google in 48 hours!

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment
On 10/7/2021 at 1:50 PM, bangank36 said:

I use readmore.js for a customer on other projects, hope this steps will help you

https://sphinx.squarespace.com/founder

- Include jquery and readmore.js as dependencies 

- In Excerpt editor, add a link named 'read more' and place the href as '#read-more'

- In my implementation, the readmore belong to a normal text block, so it slightly different, but here how I place the code

Hi bangank36,

Here's what I did:
 

1. Copy & paste the code you provided in Code Injection>Header:

image.png.cf53be78d040ff24c875eaeb3d565a16.png

 

2. Edited the excerpt

image.png.92044fec8aa1787ce01f8e4d7b5ab7c9.png

Where and how do it the the href=#read-more in the excerpt editor?

3. This is still how it looks from front:

image.png.aad80dbf0e29eb5e483d5dbc35082a4c.png

Thanks for the patience!

Link to comment
2 hours ago, 895 said:

Hi bangank36,

Here's what I did:
 

1. Copy & paste the code you provided in Code Injection>Header:

image.png.cf53be78d040ff24c875eaeb3d565a16.png

 

2. Edited the excerpt

image.png.92044fec8aa1787ce01f8e4d7b5ab7c9.png

Where and how do it the the href=#read-more in the excerpt editor?

3. This is still how it looks from front:

image.png.aad80dbf0e29eb5e483d5dbc35082a4c.png

Thanks for the patience!

What is that page url so I can have a look

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace
🚀 Learn how to rank new pages on Google in 48 hours!

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment

I' ve updated my previous codes. Kindly replace them in your code injection

Here is the step to add #read more in your summary item.

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace
🚀 Learn how to rank new pages on Google in 48 hours!

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment
20 hours ago, bangank36 said:

I' ve updated my previous codes. Kindly replace them in your code injection

Here is the step to add #read more in your summary item.

 

 

Hi bangan, thank you for the patience and help.

Here's the link

Scroll below and find the review of Daydee

image.png.61cb9d4c3a6d62527acb1d7a1496c416.png

I followed the option

image.png.7f136efac039d48493dd8563d6aff6aa.png

I also updated the code in code injection>header to:

<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/readmore.js@2.0.4/readmore.min.js"></script>
<script>
$(document).ready(function() {
	if (window.self!==window.top) {
		return;
	}
	// Issue 02
	$("[href='#read-more']").each(function(i, el) {
	    // First calculate the initial space between the content and the readmore tag   
	    const contentEl = $(el).closest(".html-block .sqs-block-content, .summary-excerpt");
      	if (contentEl.length == 0) { return false; }
	    const elBound = (el.getBoundingClientRect());
	    const contentBound = (contentEl[0].getBoundingClientRect());
	    contentEl.readmore({ 
	        collapsedHeight: elBound.y - contentBound.y,
	        speed: 500,
	        embedCSS: true, 
	        lessLink: '<a href="#" data-action="collapse-rmjs">Read less</a>'
	    })
	});
});
</script>

<style>
/* Tweak readmore js to hide the placeholder link */
[id*=rmjs] {
	transition: height 200ms;
    overflow: hidden;
}
[id*=rmjs] [href='#read-more'] {
	display: none;
}
body.sqs-edit-mode [href='#read-more'] {
	display: inline-block !important;	
}
</style>
Link to comment

You got a jquery duplication on footer, kindly remove it since I already included it in the source code

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace
🚀 Learn how to rank new pages on Google in 48 hours!

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment
29 minutes ago, 895 said:

Hi,

Removed the following line in footer injection:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

When I checked the summary, it changed but it seems not to work

image.png.c13e08255922d748df86ac2209de3a02.png

let me see

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace
🚀 Learn how to rank new pages on Google in 48 hours!

If you find my answer useful, 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, 895 said:

Hi,

Removed the following line in footer injection:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

When I checked the summary, it changed but it seems not to work

image.png.c13e08255922d748df86ac2209de3a02.png

There is a css that make  the font size of summary item to zero? I dont know why but I remove it by using this css. This is the best that I can do for this issues, if it persists, kindly send pm message so we can look through together

[data-readmore-toggle] {
  font-size: 14px;
  text-decoration: underline;
  color: #787575;
}

image.thumb.png.b2e2fce908d3ff16d5334e6585887840.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace
🚀 Learn how to rank new pages on Google in 48 hours!

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment
  • 2 weeks later...
On 10/13/2021 at 12:02 PM, bangank36 said:

There is a css that make  the font size of summary item to zero? I dont know why but I remove it by using this css. This is the best that I can do for this issues, if it persists, kindly send pm message so we can look through together

[data-readmore-toggle] {
  font-size: 14px;
  text-decoration: underline;
  color: #787575;
}

Hi bangan,

I checked in a different kind of page we had. Check reviews below https://lokalamico.com/wolfgang-vienna-host. There are three (3) of them and it didn't work. Is there a particular line of code within the page blocking it?

Thanks!

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.