Jump to content
LemmeCheck.Info

Creating An Alphabetic Category List In Tgpx


Robert
 Share

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>
{/foreach}

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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