Arrange & Re-arrange Tags to appear in specific order

Is there a way to change the order in which TAGS are listed on the frontend? I know this can be done using the order by date published but the challenge is that there is no option to modify this date in the admin side such that the tags can be re-arranged by date.

I am building a menu/table of contents based on tag names but they must appear in specific order. Also when an editor needs to introduce new items they should be able to insert it in a particular spot in the tag menu. Something like the way menu items can be dragged and positioned in the design section of the admin panel.

Any ideas or pointers are very much appreciated. Thanks

Hi @bryanlamtoo!

So you would like a navigation that’s based on tags but ordered in a specific fashion? Is there a logic behind the order? If not then it might be best to create the navigation with HTML inside a HTML card. That way you have full control. If there’s a pattern to the order then maybe we can work out something to calculate that :slight_smile:

Hi @DavidDarnes :grinning:,
Yes there is pattern in the order just like it would be in a book’s table of contents. So for each topic in the book I created a TAG and then different posts (book pages) under that TAG.

So the book navigation should sort of appear in order. I could use a HTML card but then it becomes static and an editor with no knowledge of HTML code wouldn’t easily re-arrange sections of the book.

Here is an image of what i have created so far. How could we calculate the order?

Imgur

As a hack this is what i did:
I gave each tag a description with numbers so that i could eventually use that to arrange them by description in ascending order. But it is too cumbersome because to change any TAG order, i have to re-number all tags via their descriptions :man_facepalming: I can’t even sanely explain this to an editor :woozy_face:

Imgur

That’s an interesting work around! It kinda works but I see what you mean with the ordering issue though.

You could use the #get option along with a custom page that contains all the links to your chapters and output it in your menu area. For example:

<nav>
{{#get "pages" slug="contents-navigation" as |page| }}
    {{#page}}
        {{content}}
        <!-- your page content outputted here would be just a list of links -->
    {{/page}}
{{/get}}
</nav>

Then create a page with the slug of contents-navigation and add the links like this:
52

2 Likes

Uhhh nice,

Seems like good idea. Let me try that out now. My only worry is how I would create the sub-links under each chapter.
But nonetheless, Let dive into the code and see what happens. Thanks David :slightly_smiling_face:

1 Like

You could just tab like a nested list. A navigation is just a list of links, from there you can manipulate it to your needs :slightly_smiling_face:

1 Like