Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Sort Ordering Tags and other Objects Alphabetically using JSON-T on 7.0 custom theme


bgonz

Question

Hi folks - I am trying to display "tags" on a Custom Post Type I call "Portfolio".

I am able to loop through the "section -> collection -> section -> tags" and then display the repeated results of each tag, but is there a way to alphabetize them? 

{.section collection}
  {.section tags}
  <ul class="portfolio-tags">
    <li><a href="{collection.fullUrl}">All</a></li>
    {.repeated section @}<li><a href="{collection.fullUrl}?tag={@|url-encode}" class="entry-tags-tag entry-tag-{@|slugify}" rel="tag">{@}</a></li>{.end}
  </ul>
  {.end}
{.end}

{.section tagFilter}
	<p class="filtered-by">Filtered by: {@|safe}</p>
{.end}

Is there a JSON-T Formatter that would help with this?

https://developers.squarespace.com/json-t-formatters

--

This is particularly crucial for me because the "Portfolio Items" are tagged by "year" ex: 1998, 1999, 2000

Problem is - the tags are not being aggregated (in the JSON) in a logical pattern that I can tell. You can see from the screenshot (attached) the tags are in a somewhat random order.

--

My hack, for now hopefully, is to create a custom create a Custom Block Field Region for this Custom Post Type that allows me to inject a simple "Tag Cloud" -> then use CSS to style it in a similar way as I intended. I am not a big fan of this, but it gets the job done for now until I can get a better solution. 

<squarespace:block-field id="portfolio" columns="12" />

Any suggestions?

 

Thanks in advance.

 

 

Screen Shot 2020-10-17 at 8.25.33 AM.png

Screen Shot 2020-10-17 at 8.28.03 AM.png

Screen Shot 2020-10-17 at 8.32.09 AM.png

Link to post
  • Answers 0
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Posted Images

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...