SQUARESPACE TIPS

SUMMARY BLOCK

Using js to modify Summary Block Categories & Tags.


To change the text displayed for categories and tags:

  • Paste the following code into the code injection header.

  • Change “Category Name” and “Tag Name” to the existing values.

  • Change “New Name” to the new values you want.

In the sample above the changed categories now say “CHANGED”.

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script>
  $(document).ready(function(){
    if ( $('.summary-v2-block').length ){
      $('.summary-metadata-item--cats').each(function(){
        $(this).find('a:contains("Category Name")').text("New Name"); /* duplicate this line to change multiple categories */
      });
      $('.summary-metadata-item--tags').each(function(){
        $(this).find('a:contains("Tag Name")').text("New Name"); /* duplicate this line to change multiple tags */
      });
    };
  });
</script>