Jump to content

Make button (read bio) in people / list section link to either a lightbox text or a dropdown text

Recommended Posts

Hi there!
I have a team section using simple list and would like to have the button on each team member open full bio without leaving the page. Either as a dropdown or lightbox text. It seems that the button by default can only link to a page, website, file etc.

Any help on this is greatly appreciated!

Link to comment
On 5/21/2022 at 1:51 PM, martelil said:

Thank you @tuanphan – that's  good solution. Even better if some of the bio is visible and the rest expands on a Read more-link or button. Do you have a code for this?

Like this?

readmore.thumb.png.f398e39093abb8e4ddb6774acae24327.png

Add a List Section > Paste this code into Page Header

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
 $('li.list-item').each(function(i, e) {
      $(this).click(function() {
  $(this).toggleClass('tp-list-des-open');
});
 })
});
</script>
<style>
.list-item-media:hover, h2.list-item-content__title:hover {
    cursor: pointer;
}
  .list-item-content__description {
    height: 0;
    overflow: hidden;
    transition: all 0.1s ease;
}
  .tp-list-des-open .list-item-content__description {
    height: 100%;
    transition: all 0.1s ease;
}
  h2.list-item-content__title:after {
    content: "Read Bio";
    display: block;
    font-size: 14px;
    font-style: italic;
    margin-top: 20px;
}
  .tp-list-des-open h2.list-item-content__title:after {opacity:0;}
</style>

pageheader.thumb.png.c1e5a2c42dd32952e4c968bbee99d571.png

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

Wonderful, thanks so much – this works great!

I've managed to simulate an accordion block by replacing "Read bio" with a plus character. Is there a way to add a line beneath the name / + in order to make it even more like an accordian? And is it possible to make the + not disappear on click but turn 45 degrees?

– But what I just realised is that all lists get the same "read bio" or + … even slideshows. Is there a way to have the code apply to only the specific list?

 

This is the modified code:

h2.list-item-content__title:after {
    content: "+";
    display: flex;
    justify-content: right;
    font-size: 40px;
    font-style: none;
    margin-top: -25px;
}

List_before.png

List_dropdown.png

Edited by martelil
Link to comment
16 hours ago, martelil said:

Wonderful, thanks so much – this works great!

I've managed to simulate an accordion block by replacing "Read bio" with a plus character. Is there a way to add a line beneath the name / + in order to make it even more like an accordian? And is it possible to make the + not disappear on click but turn 45 degrees?

– But what I just realised is that all lists get the same "read bio" or + … even slideshows. Is there a way to have the code apply to only the specific list?

 

This is the modified code:

h2.list-item-content__title:after {
    content: "+";
    display: flex;
    justify-content: right;
    font-size: 40px;
    font-style: none;
    margin-top: -25px;
}

List_before.png

List_dropdown.png

Can you share link to page where you added the code? We can tweak it easier

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
  • 4 months later...
On 11/1/2022 at 12:51 AM, LeonXDavis said:

Hey, was just looking at this. Would it be possible to do something similar but on a team list?

Can you share link to page where you use Team List? We can imagine easier.

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
  • 2 weeks later...
On 11/16/2022 at 4:57 AM, sarfaw said:

This whole thread saved me hours! Thank you @tuanphan!  I was wondering if there is a simple way to add "close bio" or "read less" as an alternative to clicking on a blank space to close the bio content?

You mean

Initial: show read more/open bio

Click on it >> Show text above read more/open bio, then read more/open bio text change to close bio/read less

Click close bio/read less >> hide text + change text to open bio/read more

Is this right?

You will use List Section, is that right?

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/26/2022 at 4:17 AM, sarfaw said:

yes that is exactly what I meant, thank you! And yes, with a List section.

Hi,

I did a quick demo. You can check: https://thung.squarespace.com/list-section-readmore-readless?noredirect

Pass: abc

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 12/1/2022 at 6:09 AM, sarfaw said:

@tuanphan that is exactly what I was envisioning 🙂

First, add a List Section

image.thumb.png.d5f79338e38bb429b751be41c34b6672.png

Next, add this code to Page Header (page where you use List Section)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
 $('li.list-item').each(function(i, e) {
      $(this).click(function() {
  $(this).toggleClass('tp-list-des-open');
});
 })
});
</script>
<style>
.list-item-media:hover, h2.list-item-content__title:hover {
    cursor: pointer;
}
  .list-item-content__description {
    height: 0;
    overflow: hidden;
    transition: all 0.1s ease;
}
  .tp-list-des-open .list-item-content__description {
    height: 100%;
    transition: all 0.1s ease;
}
  h2.list-item-content__title:after {
    content: "Read Bio";
    display: block;
    font-size: 14px;
    font-style: italic;
    margin-top: 20px;
}
  .tp-list-des-open h2.list-item-content__title:after {
    content: "Read Less" !important;
}
</style>

If it doesn't work, please share link to page where you added List, we can check it again easier

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
  • 1 year later...

Hi there,

How can I link a "Read Bio" button to a page within my website. I embeded the link but whenever I click the button, it always returns to the homepage. When I try to link it to another website, it works, but not for a page within my website. Please help! Thank you!

Edited by Nhung
Link to comment
On 2/25/2024 at 7:18 AM, Nhung said:

Hi there,

How can I link a "Read Bio" button to a page within my website. I embeded the link but whenever I click the button, it always returns to the homepage. When I try to link it to another website, it works, but not for a page within my website. Please help! Thank you!

Can you share link to page where you use read bio button? We can check easier

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.