Last modified: 2013-06-10 08:53:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32436, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30436 - Table data should be customizable using a token
Table data should be customizable using a token
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-18 10:22 UTC by bbilge
Modified: 2013-06-10 08:53 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description bbilge 2011-08-18 10:22:57 UTC
It is not currently possible to reformat a column of table data. For example, converting text to an image path.

Something like the following should be possible:

?capital # [[File:$1.png]]

Where $1 is a token matching the table cell data. It should also be possible to transform the token using parser functions and templates.
Comment 1 Jeroen De Dauw 2011-08-25 12:40:07 UTC
What's the usecase? You can already format results using the template parameter in formats that support it. It's not completely the same, and has some different limitations, but I figure there is a good chance you can use it instead of wait for such a new feature.
Comment 2 MWJames 2013-06-10 03:45:23 UTC
As mentioned above the use case is not clear and the bug has not been updated in over a year+. If this issue is still under active consideration please feel free to re-open it and add an use case.

Thanks
Comment 3 badon 2013-06-10 08:53:59 UTC
I was interested in this feature early-on, but I've since changed my mind. The token idea is obviously useful in my opinion, because it would allow more flexible customization of SMW's data presentation. However, where is the line drawn between the "normal" output of SMW, and customized output? 

I decided that the current methods are best to keep simple, and further customization can be done with advanced MediaWiki template programming. There are output formats that open the door for that (like arrays or delimited lists). I've decided that the complexity of customizable output is so vast, it's best to fully take control and just format it manually. Then, SMW's generic built-in formatting features can be kept simple and bug-free.

Semantic Result Formats (SRF) is an interesting example of how important it is to draw a line between simple, generic, one-size-fits-all output formatting, and fully custom formatting. The scope of what is possible is totally unmanageable natively, but as long as there is some sort of programmer-friendly output format available (arrays, delimited lists, etc), then nothing is being excluded, and nothing is impossible.

In fact, in my own template programming, I essentially add my own "token" feature to my code simply by using variables. I have my output format defined in a template of some sort (frequently just fancy rows in a table), and I print the array of data in each variable "slot". There is no practical difference from what bbilge@gmail.com was asking for with "tokens", except there are no limits to what can be done. 

For example, I sometimes create complex tables that aren't merely a grid of cells in a 1-to-1 row-column arrangement. Some of my cells might have a whole table of its own, depending on how I want to pack the information together. That wouldn't be possible with "tokens", and as such,I think the effort in adding such a feature wouldn't be an optimal investment of effort.

This became clear to me when I tried to use the "template" format for an SMW query. It was inflexible and more complicated than just getting the data in an array and outputting it exactly how I want it. As soon as I realized that, I threw away my old code in favor of fully custom formatting, and I have never used the SMW template output format ever again. I don't see questions about it very often in the mailing lists either, so I assume others have reached the same conclusion. The end result of all of this is that the work put into creating, maintaining, and bug-reporting for the template format has been largely wasted, and I think this feature request is very similar. 

It seemed like a good idea at the time, especially when it was written before the arrays extension and other template programming tools were available. Now, I think it's time to move ahead, and I agree with closing this bug. However, I changed it to "WONT FIX" instead of "INVALID". It was, and still is "valid", but it's clear now there are better ways of achieving the same goals without changing anything in SMW.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links