Semantical grouping of categories and forums

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Post Reply
User avatar
dhn
Registered User
Posts: 1518
Joined: Wed Jul 04, 2001 8:10 am
Location: Around the corner
Contact:

Semantical grouping of categories and forums

Post by dhn »

Paul, as categories, forums and links (on index) are now all regarded as another instance of the same item, it is rather difficult to group them semantically. When I try for example to group all forums that belong to a category in a list I need to be able to define the beginning and the end of the category (ul and /ul in this case).
With the current logic you use for the subSilver template this is only possible if you add an empty list in front of the forumrow:

Code: Select all

<ul>
    <!-- BEGIN forumrow -->
    <!-- IF forumrow.S_IS_CAT -->
         </ul><h2><a class="cattitle" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></h2><ul>
    <!-- ELSE -->
         <li><a class="cattitle" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></li>
    <!-- ... -->
Geeeeh, lunch now, will contniue later. 8)

Ok, back again. The above trick is not very nice as it leads to an empty list if the first forum is a category:

Code: Select all

<ul></ul>
This one is not allowed in XHTML.

If your forum does not have a parent (like this Styling forum for the time being) it will also be semantically added to a list which it does not belong to category above it.

An easy workaround would be to have template variables for the parent_id. If this one is set, the forum has a parent and belongs to the category, if it is not set, it has to be a single entry.
This might not work in subforum listings, I have to look into this.

To avoid the empty ul it would help to be able to check if the first forum in the row is a category or not.
Image

Post Reply