Jump to content

Adding Clickable Logo to Simple List Title

Go to solution Solved by tuanphan,

Recommended Posts

Hello!

I am using a Simple List section to display our group members. In some of the Titles (ie group member names) I would like to add an inline ORCID iD logo (https://info.orcid.org/documentation/integration-guide/user-experience-display-guidelines/) next to their name, which is clickable and links to their ORCID iD webpage. Is this achievable using CSS and HTML code blocks or do I need header/footer injection? 

Website: https://point-trumpet-33bp.squarespace.com /The Group

Here is what I would like to achieve (except not the underline) next to some of their names.

 image.png.10cdde7de9a0acc89d5c57ad494f8de5.png

Thank you!!

Link to comment
  • Replies 3
  • Views 285
  • Created
  • Last Reply

Top Posters In This Topic

You can use this code to Website Tools > Custom CSS. Repeat similar for other items

/*Add an icon under List Item Titles*/
section[data-section-id="64e45341bb8e1b36f0a8ac78"] {
ul.user-items-list-simple li .list-item-content__title {
    display: flex;
    align-items: center;
    justify-content: center;
}
ul.user-items-list-simple li .list-item-content__title:after {
    content: "";
    background-position:center;   
    z-index:9999;
    background-size: contain;
    background-repeat: no-repeat; 
    display: inline-block;
    width: 30px;
    height: 30px;
}
ul.user-items-list-simple li:nth-child(1) .list-item-content__title:after {
    background-image: url(https://cdn.pixabay.com/photo/2016/10/31/00/53/shield-1784661__340.png);
}
ul.user-items-list-simple li:nth-child(2) .list-item-content__title:after {
    background-image: url(https://cdn.pixabay.com/photo/2016/11/30/18/14/light-bulb-1873540__340.png);
}
ul.user-items-list-simple li:nth-child(3) .list-item-content__title:after {
    background-image: url(https://cdn.pixabay.com/photo/2024/05/04/01/25/white-tailed-eagle-8738135_1280.jpg);
}}

image.thumb.png.016a2138e1c1e75f5a81e04176c6abca.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
  • Solution

With clickable, you will need to use different code

Use this code to Website Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function(){
    $('<a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2024/08/06/14/43/dolphin-8949505_1280.jpg" width="50px"/>').appendTo('section[data-section-id="64e45341bb8e1b36f0a8ac78"] li:nth-child(1) h2');
     $('<a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2021/08/07/08/49/building-6528079_1280.jpg" width="50px"/>').appendTo('section[data-section-id="64e45341bb8e1b36f0a8ac78"] li:nth-child(2) h2');
     $('<a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2024/04/12/23/11/nature-8692760_1280.jpg" width="50px"/>').appendTo('section[data-section-id="64e45341bb8e1b36f0a8ac78"] li:nth-child(3) h2');
});
</script>
<style>
  h2.list-item-content__title img {
    margin-left: 10px;
    width: 30px;
}
h2.list-item-content__title {
    display: flex;
    align-items: center;
    justify-content: center;
}
</style>

image.thumb.png.b1a3bd56fa0a9c757662e60d2fb69efa.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

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.