Hi all,
Here’s a quick snippet that I wrote for my site, I thought it might be useful to someone so decided to post it here.
The snippet allows for a simple A to Z listing to be displayed for site, filtered by a letter of the alphabet.
It outputs to two placeholder values, [+atozletters+] and [+atozresults+].
To run, you need to include the snippet on the page, and then use the placeholders above to display the letter selection and results on the page (you can use a chunk to display the output in a particular format)
Demo URL: http://www.immerse.me.uk/A-to-Z.html
Version 6 offers the ability to have multiple startid’s and an extra ’letter’ of the alphabet has been added so titles that start with a non-alphabet character can be listed.
The snippet does not display documents that have been deleted, are unpublished, or that have private web permissions assigned to them.
Snippet Variables
These are some snippet variables that can be used to customise the output of the snippet:
- &title: This relates to a column in the site_content table and will be displayed as the main hyperlink to the page. Examples are: pagetitle, longtitle.
- &norecords: The message to be displayed when no records are returned for a particular letter.
- &intro: The message that will be displayed when the page is first opened (ie. no letter has been selected)
- &summary: Optional second column from the site_content table to display, for example, introtext. Ideal for displaying a short description of the page.
- &startid: Optional id of a start folder (can be comma separated to include multiple start ids), useful if you wish to only list the contents of a particular folder(s).
- &hidemenu: Optional boolean value (true or false) that sets if the listing will not display documents that have ’Hide in Menu’ set. (Default: honours Hide in Menu option)
CSS Styling
The following CSS classes can be used to style the output:
- azalpha: This styles the letters of the alphabet.
- azsep: This styles the separator between the letters of the alphabet.
- azlist: The style applied to the top <ul> in the results placeholder.
Example Snippet Call
[!atoz? &intro=`Please choose a letter from the above selection` &norecords=`Sorry, no pages have been found for this page` &summary=`longtitle` &startid=`2,24` &hidemenu=false!]
Let me know what you think, it’s only a basic snippet but I’ll be happy to expand it if there’s enough interest.
Cheers, Garry
(version 5: 126 downloads)