A-Z Asset Listing


(gja) #1

Hi,

 

I'm creating an A-Z asset listing which is including a number of assets including pdfs.

 

I have found that the assets are being grouped by the first character of the  asset name (%asset_name%) and not  %asset_short_name% as suggested by the manual http://manuals.matrix.squizsuite.net/asset-listing/chapters/a-z-listing.

 

To check what asset it is being grouped on I have set the pdf format to be

<li><a href="%asset_url%">%asset_attribute_title%</a> Short &nbsp;Name: %asset_short_name% Asset Name:%asset_name%</li>

 

with resultant output

 

[Other]

2Degrees FAQs Short  Name: 2Degrees FAQs Asset Name:2Degrees-FAQs.pdf Where can I find 2Degrees Phone and Data Plans Short  Name: Where can I find 2Degrees Phone and Data Plans Asset Name:2Degrees_Plans.pdf

 

We are on version 5.1.5.0

 

Any thoughts?

Thanks Georgina.


(gja) #2

As an update:

 

For standard pages - A-Z is grouping by "Page Name" and not Page Short Name

For pdfs - A-Z is grouping by "File Name" and not Title

 

So for standard pages the grouping isn't as per the manual either.


(Tim Davison) #3

I've never liked the default way A-Z format worked, in particular the code rendered, so I've always done them by custom grouping.  Gives a bit more flexibility as well.  You will need two listings to do it though.

 

To get the A-Z grouping make top-level grouping by Keyword, use the following:

asset_short_name^maxchars:1^uppercase

Then in one listing (call it the nav) you do the list of links to each letter.  Most code will be in the group format, the default format will be empty.  In the second listing it will be the full list, group formats will have the titles (e.g. A, B, C etc) and default formats have the actual entries (however you want to display them).  Both listings will be created exactly the same, custom grouping by the keyword combination above.  The only thing different is the bodycopies.

 

Then, to use in a page, I usually nest them in a Std Page.  Nest the nav listing first (will print the alphabetic links) and then nest the other one.  

 

I've enhanced this even further, so that the A-Z listings accept a replacement root node via GET value.  When nesting you specify the root node in the variables section.  Once created you then have a re-usable A-Z listing that has code that completely conforms to whatever you want.  If you want to use a different think to sort by, change the keyword combo in the grouping section.

 

There are some downsides (but both can be mitigated):

  1. need to nest 2 listings instead of just a single A-Z page (as a personal rule I always nest listings anyway).
  2. The A-Z links across the top has 'gaps'.  I.e. if there's no asset underneath that starts with 'B' then it will go "A, C, etc".  Usually an A-Z will have a lot of entries (that's the point of them) so unlikely to be a showstopper (actually, when I showed it to my boss she thought it was a feature I'd purposefully coded in).  If it *really* is a problem you can create a folder with Data Records (or some other less-used asset) with names matching all the letters of the alphabet, and include this in the listings.  Then use a different type format bodycopy for this type in the main listing so they are not shown.  Headings will be the group titles.  Personally I think that's overkill, most cases the gaps aren't a big deal (or are preferred).

 

Cheers