Jump to content

How to add 'back to work' button next to portfolio pagination?

Recommended Posts

Hi! I would love to add a button with 'back to all work' in between my portfolio pagination (see screenshot). The only way people can come back to my homepage now (which is also the start of my portfolio page) is to click my logo in the header or footer, or click 'werk' in the navigation. I tested my website on some people and they really miss a clearer option. 

I found some codes online offered by @tuanphan, but unfortunately they don't do anything for me. 

The codes are the two added underneath. Can someone maybe help me with this? Thank you in advance!

password: Illusterre2022 https://illusterre-sample.squarespace.com 

#19. Add Button to Pagination

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() { 
        $('<a href="/portfolio" class="item-pagination-link item-pagination-link--prev portfolio-backto"><div class="item-pagination-icon icon icon--stroke"><svg class="caret-left-icon--small" viewBox="0 0 9 16"><polyline fill="none" stroke-miterlimit="10" points="7.3,14.7 2.5,8 7.3,1.2"></polyline></svg></div><span class="pagination-title-wrapper"><div class="visually-hidden">Back to Work</div><div class="item-pagination-prev-next">- BACK TO WORK</div><h2 class="item-pagination-title">BACK TO WORK</h2></span></a>').insertBefore('a.item-pagination-link.item-pagination-link--next');
    });
    </script>
    <style>
    /* Portfolio back to button */
a.portfolio-backto .item-pagination-title {
    background-color: black;
    color: white !important;
    padding: 10px;
}
</style>

and 

#20. Add “Back to all projects” under pagination

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function($) { 
   $('<section id="back-to"><div class="sqs-block-button button-block Index-page-content"><div class="sqs-block-button-container--center"><a href="/portfolio" class="sqs-block-button-element--small sqs-block-button-element sqs-button-element--primary">Back to all project</a></div></div></section>').insertAfter('.item-pagination[data-collection-type^="portfolio"]');
 }); 
</script>

Schermafbeelding 2022-11-25 om 11.09.10.png

Link to comment
  • Replies 4
  • Views 547
  • Created
  • Last Reply

Top Posters In This Topic

22 hours ago, Illusterre said:

Hi! I would love to add a button with 'back to all work' in between my portfolio pagination (see screenshot). The only way people can come back to my homepage now (which is also the start of my portfolio page) is to click my logo in the header or footer, or click 'werk' in the navigation. I tested my website on some people and they really miss a clearer option. 

I found some codes online offered by @tuanphan, but unfortunately they don't do anything for me. 

The codes are the two added underneath. Can someone maybe help me with this? Thank you in advance!

password: Illusterre2022 https://illusterre-sample.squarespace.com 

#19. Add Button to Pagination

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() { 
        $('<a href="/portfolio" class="item-pagination-link item-pagination-link--prev portfolio-backto"><div class="item-pagination-icon icon icon--stroke"><svg class="caret-left-icon--small" viewBox="0 0 9 16"><polyline fill="none" stroke-miterlimit="10" points="7.3,14.7 2.5,8 7.3,1.2"></polyline></svg></div><span class="pagination-title-wrapper"><div class="visually-hidden">Back to Work</div><div class="item-pagination-prev-next">- BACK TO WORK</div><h2 class="item-pagination-title">BACK TO WORK</h2></span></a>').insertBefore('a.item-pagination-link.item-pagination-link--next');
    });
    </script>
    <style>
    /* Portfolio back to button */
a.portfolio-backto .item-pagination-title {
    background-color: black;
    color: white !important;
    padding: 10px;
}
</style>

and 

 

#20. Add “Back to all projects” under pagination

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function($) { 
   $('<section id="back-to"><div class="sqs-block-button button-block Index-page-content"><div class="sqs-block-button-container--center"><a href="/portfolio" class="sqs-block-button-element--small sqs-block-button-element sqs-button-element--primary">Back to all project</a></div></div></section>').insertAfter('.item-pagination[data-collection-type^="portfolio"]');
 }); 
</script>

Schermafbeelding 2022-11-25 om 11.09.10.png

Have you added the above codes to your site? I can not find them now

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

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

You can try adding them again and I can take a look your issue

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

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

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.