Jump to content

Summary block - How to change Delimiter style?

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Posted (edited)

Summary block under nyheter / news: backup-20230726.squarespace.com ; pass: 048900

Under "Äldre inlägg"/"Older posts" i managed to change it without any code.

Also under Read more specifik post, the picture is above the text, you guys know how to make it like the two first pages?

Edited by Mystah
Link to comment
Posted (edited)

I manged to add "|" but i can't get rid of the "•" with this code (maybe im getting close?):

.summary-metadata--primary:after {
  content: "|";
  font-weight: 500;
  padding-left: 0.25px;
  padding-right: 4.5px;
}

Now its looking like this: " Göteborg • | 8 juli 2023 "

Edited by Mystah
Link to comment

Add this to Design > Custom CSS to remove it

.sqs-block-summary-v2 .summary-block-setting-secondary-metadata-date .summary-metadata--primary .summary-metadata-item:after {
    display: none;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
Posted (edited)
2 hours ago, tuanphan said:

Add this to Design > Custom CSS to remove it

.sqs-block-summary-v2 .summary-block-setting-secondary-metadata-date .summary-metadata--primary .summary-metadata-item:after {
    display: none;
}

 

Thanks mate! That worked!

Then i have one more question. Is it possible to use an CSS code instead of JavaScript coding to get the date the way i have it now inside blog posts (items)?

Also when im trying to use this on the first page for the Summary block, some of the "News" get invalid date, you know how to fix that?

 

<script> document.addEventListener("DOMContentLoaded", function(event) {
    var dateMeta = document.querySelector('[itemprop=datePublished]');
    if (dateMeta != null) {
      var publishedDate = new Date(dateMeta.content);
      var dateElem = document.querySelector('time span');
      updateDateElement(dateElem, publishedDate);
    }
    else {
      var times = document.querySelectorAll('time');
      for (var i = 0; i < times.length; i++) {
        var dateElem = times[i];
        var publishedDate = new Date(dateElem.innerHTML);
        updateDateElement(dateElem, publishedDate);
      }
    }
  });
  function updateDateElement(elem,date) {
    var dateFormat = { year: 'numeric', month: 'numeric', day: 'numeric' };
    var newFormat = date.toLocaleDateString(undefined, dateFormat);
    elem.textContent = newFormat;
  }
</script>

Edited by Mystah
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.