Streaming live at 10am (PST)

Display the length of my collection

Hello, first time posting. Sorry in advance if this is not the correct place to post.

A couple questions:

  1. Is there a way I can display the length of my collection?
  2. Is there a way to display the index count?

In a nutshell I would like to display the paginated numbers
Screen Shot 2020-06-13 at 10.09.28 AM

Here is an example of what I am shooting for

Thanks for the help.

1 Like

Hey ho!

Can you provide a link to your read-only designer?

Hi, I actually figured it out. I just added some custom Javascript code, something like this

<script>
  let pageCount = document.getElementsByClassName('page-count')[0];
  let pageCountSplit = pageCount.innerHTML.split('/ ');

  formatPaginationNumbers();
  
  function formatPaginationNumbers() {
  	// if under 10 add a zero in front of the number
    if (pageCountSplit[1] < 10) {pageCountSplit[1] = '0' + pageCountSplit[1];}
    if (pageCountSplit[0] < 10) {pageCountSplit[0] = '0' + pageCountSplit[0];}	

	pageCount.innerHTML = pageCountSplit[0] + '/ ' + pageCountSplit[1]
  }

</script>
1 Like