Sorry - referenced wrong patch in previous post.

After a couple of weeks of fermentation, this one is shaping out a little.

Primary functional difference is to use the format=template parameter with
the ability to introduce template header and footers around the returned
queries formatted by the row template (introtemplate, template,
outrotemplate).

I've been experimenting with ways to make tabular queries more functional
and came to the conclusion that the ability to use templates for both the
header and rows when specified in the query (#ask) might take us a long way
there.

This has been submitted as
https://bugzilla.wikimedia.org/show_bug.cgi?id=22037

A users guide on how to implement these features can be found here
<https://wiki.montcopa.org/TestWiki/index.php?title=Advanced_Table_Formattin
g_for_SMW_Queries>.

Some of the problems we've faced in presenting tabular queries are:

1.      Concatenate Fields - A specific example is using a complete name
with a single link instead of having three different fields (Last, First MI)
into a single column.
2.      Column/Cell Level Text Alignment - Changing the text alignment in a
cell or column.
3.      Define whether or not a column is sortable.
4.      Highlight Cells (via formatting) based on content.
5.      Define Column Widths to enhance readability.
6.      Define Table Width (allow left/right scrollability instead of
"scrunching" for very wide tables).

We have been doing this by using query templates within the article, but
that approach falls apart when there are "... further results" because said
formatting is not transferable the the Special:Ask query as a template would
be.

The proposed solution is fairly straightforward;  enable the use of
templates for both the header and the rows of the tables using one existing
parameter and two new ones:

The two new parameters would be:

introtemplate - a template that can define the class of the entire table and
the column headings cells
outrotemplate - would close the table (and any other opened containers from
introtemple) as well as adding footer information

The existing parameters to be used:
format=template
template - defines each returned row from query

The code necessary to accomplish can all be done in SMW_QP_list.php and the
changes are 100% backwards compatible with minimal or no performance impact
if the features are not used. (patch
<https://bugzilla.wikimedia.org/attachment.cgi?id=6988> )

You can test it (with examples and documentation) here
<http://wiki.montcopa.org/TestWiki/index.php?title=JDPTestPage> .

________________________________

Jack D. Pond
"The ladder of success is never crowded at the top." -- Napoleon
Hill(1883-1970) 


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to