From: Jack D. P. <jac...@ps...> - 2010-01-10 23:55:52
|
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: headertemplate - a template that can define the class of the entire table and the column headings cells fixedwidth - would allow the tablewidth to be defined, including oversized tables that use horizontal scrolling The existing parameter to be used: template - the template that would define a row The code necessary to accomplish can all be done in SMW_QP_Table.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=6941> ) You can test it (with examples and documentation) here <http://wiki.montcopa.org/TestWiki/index.php?title=JDPTestPage> . ________________________________ I'd like to move forward with this concept and would appreciate feedback including: 1. Review to make sure concept is solid and will not have unintended consequences 2. Review for code and quality issues 3. Alternatives for implementation 4. Discuss whether or not this invites XSS security issues ________________________________ Jack D. Pond "The ladder of success is never crowded at the top." -- Napoleon Hill(1883-1970) |