Return to main site

Reporting

Labels enclosed on their own HTML tags

Starting from revision 979 labels provided for the textpattern listing tags <txp:recent_articles />, <txp:recent_comments />, <txp:linklist />, <txp:related_articles />, <txp:category_list />, <txp:section_list /> and <txp: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>
<ul>
<li><!-- first link here --></li>
<li><!-- second one here --></li>
<li><!-- and so on --></li>
</ul>

If 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 depends on each site markup so, much better to leave the tag to your choice.

---

Comment

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

    Anton Andreasson · Sep 30, 12:27 PM · #

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

    Jeff Adams · Sep 30, 04:18 PM · #

  3. How about labeltag for search_input?

    — nicck · Sep 30, 05:00 PM · #

  4. Pedro, You The Man !

    Jérémie · Sep 30, 06:32 PM · #

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

    David · Oct 3, 01:37 PM · #

  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.

    Timo Grant · Oct 4, 11:05 PM · #

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

    Mats · Oct 5, 11:15 AM · #

  8. what about the option to use dl lists?

    then you could use a dt for the label, and dd’s for each item…

    j

    jon Bennett · Oct 27, 12:36 AM · #