For clarity on this topic, I’m going to lay out what I need first, then try to explain my thoughts on solving it.
Our site’s main staple, is a content type called “Topic”. It’s pretty much the bread and butter of our operation. In the Content Explorer, these topics are organized in folder structures according to categories and other things we feel are important distinguishing features. Due to the large number of topics though, and the need for a person to rapidly navigate to the appropriate topic, we have implemented an alphabetical listing in our global template. To do this, we have created one autoindex for each alphabet letter (A - Z + #), we also have one to contain everything that starts with a number. Currently the location scheme to provide a simple path to the file, like A.html, B.html, etc. These autoindex lists are publishing correctly, and work great.
So our current problem is that in the global template, we have a navigation region which contains all of the links to these alphabetical lists, each of these links are currently hard coded to point at one of the alphabetical lists, but these pages do not exist during preview, and therefore these links do not work. I would like to convert them to managed navigation, but I just can’t seem to see a clear way to do this.
I think a basic slot will not work because this has to be in the global template, and I can’t see a way to populate a slot with these items. Typically you would edit a single content item, and populate the slot, but this action would populate that slot ONLY for that one content item, and we have hundreds of content items.
A typical managed nav slot would not work here, because these items are arranged structurally in a way that is NOT alphabetical, and re-arranging them into an alphabetical structure is not an option. My understanding of managed nav slots is that they function on folder structure.
An auto slot MIGHT work, but my query would have to specifically name the content items that I wanted, I could sort the content items alphabetically. The only problem I can foresee is that in addition to letters a-z, I need one listing for all topics that start with a number rather than a letter, and it needs to be last in the list, how can I guarantee that this will happen? Currently this numeric list is denoted with a # symbol, which sorts BEFORE the letter A. Another problem with this approach is that the content type for these alphabetical lists is “autoindex” and the autoindex content type is used for more than just these alphabetical listings, so I would need to build the query to only find a specific list of content items.
Abandoning the idea of slots altogether, I thought I might be able to simply use $rx.location.generate() to generate the correct path. This is the simplest and most desirable to me, because the alphabet is finite, and therefore will not be gaining new letters any time soon. Once I have built this functionality it is unlikely that it will change, so a slot is overkill. Also, this is a great solution because it will solve some other navigation issues that are similar in nature, such as a link in the header to the FAQ page. The only problem with this solution is that $rx.location.generate() requires a content item to be passed to it, and I only have a content ID. I can’t seem to find any functions that accept an ID and return the full content item.
So I apologize if that was a bit long winded, but really I guess what I’m asking is: What is the best practice for embedding links into your global template, which point to specific content items?
Thanks,
-Jason