Hi,

The other thread about #subobject and #set_internal reminded me that I've
been meaning to ask about this:

Currently #subobject names all the subobjects it creates in the form "Page
name#hash" (I referred to the hash previously, incorrectly, as a "random
string"). There's a problem with this approach, though, which is that the
subobject names don't preserve the order in which they were created. Let's
say you have a bunch of #subobject calls in a page (ideally within
multiple-instance templates, though it could be done in any way),
representing something that has a natural order, like a set of sub-tasks in
a project, and you want to display all those sub-tasks in some table on
another page. An #ask query on another page won't display them in the same
order in which they were entered - by default, it'll go by the subobject
name, which will display them in a random (or random-seeming) order.

You could of course require users to enter a number for each entry, and
then sort on that in the queries; or you could use an extension like
NumerAlpha [1] (I haven't used it, so I don't know how well it actually
works), but I think it would be nice for this to just work out of the box -
that, without any additional work, subobjects get displayed in queries in
the same order in which they were entered.

If having the unique hash element is important, I can think of a solution
that would preserve that, while also making the ordering correct. Right now
subobject names look like:

Page name#_4bd1f1b74a76de5322dd74956a71f089
Page name#_03163dfd1d2502668b00c1f521688984

You could just prepend an index number at the beginning, so they would
instead look like:

Page name#001_4bd1f1b74a76de5322dd74956a71f089
Page name#002_03163dfd1d2502668b00c1f521688984

Without getting into the details of technical implementation - does that
sound like a reasonable change?

[1] https://www.mediawiki.org/wiki/Extension:NumerAlpha

-Yaron

-- 
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to