Labels enclosed on their own HTML tags

Starting from revision 979 labels provided for the Textpattern listing tags (recent_articles, recent_comments, linklist, related_articles, category_list, section_list and file_download_list) will be nevermore added as the first item of those lists.

Those labels will be placed just before the corresponding list, enclosed with the HTML tag provided as the value for the new attribute: labeltag.

Example usage:

<txp:linklist wraptag="ul" break="li" label="The links" labeltag="h4" />

will display:

<h4>The links</h4>
  <li><!-- first link here --></li>
  <li><!-- second one here --></li>
  <li><!-- and so on --></li>

If the labeltag attribute isn’t specified, the label, followed by a <br /> will precede the wraptag and its contents.

We know that it might not be the perfect solution (and think that there isn’t a perfect one) since the semantically correct option will depend on each site’s markup – it’s much better to leave the tag to your personal choice.


  1. Great news! Been tampering with other solutions to get this appearance working… supposing the label is invisible if the list is, right?

  2. Excellent, This is one issue that has been bothering me since the label attribute was created. Thanks!

  3. How about labeltag for search_input?

  4. Pedro, You The Man!

  5. This is going to be real nice :-) Thx !!

  6. Yahoo ! Now we have a new Tag for lists of links. More fantastic opportunities wait for me to make them real.

    I plan to make a list of new weblinks to blogs, sites I like, all my fellas and some excellent photo art galleries too.

  7. Is there a way to get the development branch from SVN?

  8. What about the option to use dl lists?

    Then you could use a dt for the label, and dds for each item…

Commenting has expired for this article.