Opened 14 years ago

Closed 13 years ago

Last modified 7 years ago

#2749 closed defect (fixed)

ListTagged in 0.6 does not give the titles of the pages from the first heading

Reported by: blyth Owned by: Alec Thomas
Priority: normal Component: TagsPlugin
Severity: normal Keywords: ListTagged
Cc: blyth@… Trac Release: 0.11


In prior versions of TracTags the full title of pages as gleaned from the first heading on the page was presented in the ListTagged list of pages making the list much more informative than just the page names

Attachments (0)

Change History (7)

comment:1 Changed 14 years ago by blyth

Component: TracTagsXmlrpcPluginTagsPlugin
Owner: changed from Mike Buzzetti to Alec Thomas

comment:2 Changed 14 years ago by Alec Thomas

This is a "feature" of using 0.11's resource system. If people really want this behaviour back I can special-case the Wiki title.

comment:3 Changed 13 years ago by jsilence

I'd second the feature request...


comment:4 Changed 13 years ago by blyth

Cc: blyth@… added; anonymous removed

This would make ListTagged so much more useful to me that I would like to re-state my enhancement request

comment:5 Changed 13 years ago by blyth

Here is my diff to do precisely what I requested, I hope that this can be added to trunk.

--- File (revision 3766)
+++ File (working copy)
@@ -13,6, +13,8 @@
  from tractags.api import TagSystem 
  from genshi.builder import tag as builder 
+ from import model 
+ import re 
  def render_cloud(env, req, cloud, renderer=None): 
      """Render a tag cloud 
@@ -70,6, +72,20 @@
  class ListTaggedMacro(WikiMacroBase): 
+     first_head = re.compile('=\s+([^=]*)=') 
+     def wikipage_first_heading(self, page): 
+         from import model 
+         page = model.WikiPage(self.env, page) 
+         title = '' 
+         if page.exists: 
+             ret = 
+             title = ret and or '' 
+         return title 
      def expand_macro(self, formatter, name, content): 
          req = formatter.req 
          query_result = TagSystem(self.env).query(req, content) 
@@ -83,15, +99,21 @@
          for resource, tags in sorted(query_result, 
                                       key=lambda r: str(r[0].id)): 
              tags = sorted(tags) 
+            if resource.realm == 'wiki': 
+                 desc = ' ' + self.wikipage_first_heading( 
+             else: 
+                 desc = '' 
              if tags: 
                  rendered_tags = [ 
                      link(resource('tag', tag)) 
                      for tag in tags 
-                 li =, ' (', rendered_tags[0], 
+                 li =, desc,' (', rendered_tags[0], 
                                  [(' ', tag) for tag in rendered_tags[1:]], 
-                 li = 
+                 li =, desc ) 
              ul(li, '\n') 
          return ul 

comment:6 Changed 13 years ago by Alec Thomas

Resolution: fixed
Status: newclosed

(In [3880]) Reimplement descriptions for tagged objects. Fixes #2749.

Note: This is a tag provider API change.

comment:7 Changed 7 years ago by Steffen Hoffmann

In 14159:

TagsPlugin: Finally fix TagSystem.describe_tagged_resource, refs #2749.

While correcting [14156] the original implementation from [3880] is now fully
reworked into a reliable resource description getter method, obsoleting other

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.