Modify ↓
#10724 closed enhancement (duplicate)
[PATCH] render inner macros inside the SQLTable macro
Reported by: | falkb | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | WikiTableMacro |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
Imagine this construct:
{{{ #!SQLTable SELECT DISTINCT ( SELECT value FROM session_attribute WHERE name='pagemoderator' AND Sid=m.Sid ) AS "Standard", "[[Image(" || REPLACE( REPLACE( ( SELECT value FROM session_attribute WHERE name='picture_href' AND Sid=m.Sid ), '/myproject/raw-attachment/wiki/', '' ), '/', ':') || ", center, 50px)]][[BR]]" || ( SELECT value FROM session_attribute WHERE name='name' AND Sid=m.Sid ) AS "Moderator", ( SELECT value FROM session_attribute WHERE name='email' AND Sid=m.Sid ) AS "Email" FROM session_attribute m WHERE name='pagemoderator' AND NOT value='' ORDER BY Standard }}}
The following patch let the table appear with all bells and whistles:
-
wikitablemacro/trunk/wikitable/table.py
14 14 from trac.core import implements 15 15 from trac.web.chrome import ITemplateProvider, add_stylesheet 16 16 from trac.wiki.formatter import system_message 17 from trac.wiki import wiki_to_html 17 18 from trac.wiki.macros import WikiMacroBase 18 19 from trac.util.html import Markup 19 20 from trac.util.text import exception_to_unicode … … 64 65 css_class = (idx % 2 == 0) and 'odd' or 'even' 65 66 print >> out, " <tr class='%s'>" % css_class 66 67 for col in row: 67 print >> out, "<td>%s</td>" % col 68 text = wiki_to_html(StringIO(col).getvalue(), self.env, req) 69 print >> out, "<td>%s</td>" % text 68 70 print >> out, " </tr>" 69 71 70 72 print >> out, " </tbody>"
Attachments (0)
Change History (6)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Thanks, I'm testing it out now. Note that wiki_to_html
is deprecated, and format_to_html
should be used instead.
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #4452, please follow-up in that ticket.
Note: See
TracTickets for help on using
tickets.
probably solves #4452