Jump to content

Creating An Alphabetic Category List In Tgpx


Recommended Posts

To create an alphabetical category list, simply follow the procedure below:

1. Create a New Page in your TGPX Admin and give it an appropriate name, like Categories.

2. Go to Edit Templates and place the following in your new page template:

{categories var=$categories order=name startswith=A}
{foreach var=$category from=$categories counter=$counter}
<li><a href="/path/to/{$category.name|htmlspecialchars|strtolower|treplace_special::''}/">{$category.name|htmlspecialchars}</a> <small>{if $category.used == 0}(0){else}({$category.used|htmlspecialchars}){/if}</small></li>

This will create a bulleted list of categories, starting with the letter "A", and include a link to that category. It will also give you a list of how many galleries are in that category.

3. Repeat this for each category letter you want to add. Thus, if you wanted all 26 letters, you would simply repeat the code above 26 times, and just need to change the variable on the first line where it says "startswith=A" (change A to B or to C or whatever letter you like).

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. policies