https://bugzilla.wikimedia.org/show_bug.cgi?id=22037

Jack D. Pond <jack.p...@psitex.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #6941|0                           |1
        is obsolete|                            |

--- Comment #7 from Jack D. Pond <jack.p...@psitex.com> 2010-01-20 16:45:39 UTC 
---
Created an attachment (id=6985)
 --> (https://bugzilla.wikimedia.org/attachment.cgi?id=6985)
introtemplate and outrotemplate functionality + params passing fix to
Special:Ask

If at first you don't succeed. . . .
Yaron really helped me out with this one.  His suggestion is to move the code
from SMW_QP_Table.php to SMW_QP_List.php and use two new parameters (basically
table header and table footer) as follows:

introtemplate - reference to template inserted before query returns
outrotemplate - reference to template inserted after all query returns

These two parameters extend the functionality of the format=template query.

Example:
{{#ask:
 [[Category:Active Participants List]] [[Client Status::Pending]] 
 |?Client Last Name
 |?Client First Name
 |?Client MI
 |?Client Status
 |?Client Referral Date
 | format=template
 | introtemplate=MHUserHdr
 | template=MHUserRow
 | outrotemplate=CustomOutro
 | link=none
 | limit=3
}}

In this case the introtemplate initiates a custom table - with header columns (
"{| . . ." ) and the outrotempate closes the custom table ( "|}" ).

Advantage to this approach is far simpler (requires only 4 lines of code).

Additionally this fixes the missing parameters which should have been passed to
the Special:Ask via the "...further results" link - which keeps the returned
query list consistent with the original query.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to