From: Thorbergsen, E. <eve...@br...> - 2011-08-24 07:21:46
|
Hi, How do you sort a query of pages by page name as second (or third, ...) sort criterion when the article name is not set and named as a property? This used to work (1.6), but not anymore (1.6.1), sorting by Date and within each date the article name: |sort=Date, In order words: What is the parallel to "?" / "{{PAGENAME}}" for selection / filtering, when applied to sort? Regards, Even Thorbergsen |
From: badon <fas...@gm...> - 2011-08-25 04:36:43
|
This is a good question. I ended up just using the sortable class on a templatized table output. Then, I could sort any field, in any direction, just by clicking on it. My way of doing it looks something like this: {{#ask: [[Category::+]] | ? | format=template | template=Table row output | introtemplate=Table start | outrotemplate=Table end | link=none }} Template:Table start looks like this: {| class="wikitable sortable" ! Page name !! Column 2 !! Column 3 !! Column 4 !! Modification date |- Template:Table row output looks like this: | {{#show: {{{1}}} | ?}} | {{#show: {{{1}}} | ?Property 2}} | {{#show: {{{1}}} | ?Property 3}} | {{#show: {{{1}}} | ?Property 4}} | {{#show: {{{1}}} | ?Modification date}} |- Template:Table end looks like this: |} All three of those templates together assembles a table for me, where I can customize the display however I like. Of course, the default Semantic MediaWiki table already does that for simple queries, but if you have something more complicated, this is how you get a sortable table for yourself. This probably isn't exactly what you're asking for, but maybe it'll be helpful nonetheless. Thorbergsen, Even wrote: > > Hi, > > How do you sort a query of pages by page name as second (or third, ...) > sort criterion when the article name is not set and named as a property? > This used to work (1.6), but not anymore (1.6.1), sorting by Date and > within each date the article name: > > |sort=Date, > > In order words: What is the parallel to "?" / "{{PAGENAME}}" for selection > / filtering, when applied to sort? > > > Regards, > Even Thorbergsen > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > > -- View this message in context: http://old.nabble.com/Sorting-by-non-property-article-name-as-second-criterion-tp32324423p32331453.html Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com. |
From: trueskew <tru...@gm...> - 2011-08-25 14:50:57
|
Your example brings up something I've wondered about that maybe someone in the group has looked into. In the context of the example for this thread, assuming a LAMP environment, MW 1.6, and the latest semantic bundle, what would you expect to perform better, 400 query / displays like this: {{#ask: [[Category::+]] | ? | format=template | template=Table row output | link=none }} | {{#show: {{{1}}} | ?}} | {{#show: {{{1}}} | ?Property 2}} | {{#show: {{{1}}} | ?Property 3}} | {{#show: {{{1}}} | ?Property 4}} | {{#show: {{{1}}} | ?Modification date}} |- Or 400 like this: {{#ask: [[Category::+]] | ?Property 2= | ?Property 3= | ?Property 4= | ?Modification date= | format=template | template=Table row output | link=none }} | {{{1}}} | {{{2}}} | {{{3}}} | {{{4}}} | {{{5}}} |- I would think the second one, but if it's negligible due to record caching, the first way is preferable aesthetically. Thanks - skew -----Original Message----- From: badon [mailto:fas...@gm...] Sent: Wednesday, August 24, 2011 9:37 PM To: sem...@li... Subject: Re: [Semediawiki-user] Sorting by non-property article name as second criterion This is a good question. I ended up just using the sortable class on a templatized table output. Then, I could sort any field, in any direction, just by clicking on it. My way of doing it looks something like this: {{#ask: [[Category::+]] | ? | format=template | template=Table row output | introtemplate=Table start | outrotemplate=Table end | link=none }} Template:Table start looks like this: {| class="wikitable sortable" ! Page name !! Column 2 !! Column 3 !! Column 4 !! Modification date |- Template:Table row output looks like this: | {{#show: {{{1}}} | ?}} | {{#show: {{{1}}} | ?Property 2}} | {{#show: {{{1}}} | ?Property 3}} | {{#show: {{{1}}} | ?Property 4}} | {{#show: {{{1}}} | ?Modification date}} |- Template:Table end looks like this: |} All three of those templates together assembles a table for me, where I can customize the display however I like. Of course, the default Semantic MediaWiki table already does that for simple queries, but if you have something more complicated, this is how you get a sortable table for yourself. This probably isn't exactly what you're asking for, but maybe it'll be helpful nonetheless. Thorbergsen, Even wrote: > > Hi, > > How do you sort a query of pages by page name as second (or third, > ...) sort criterion when the article name is not set and named as a property? > This used to work (1.6), but not anymore (1.6.1), sorting by Date and > within each date the article name: > > |sort=Date, > > In order words: What is the parallel to "?" / "{{PAGENAME}}" for > selection / filtering, when applied to sort? > > > Regards, > Even Thorbergsen > ---------------------------------------------------------------------- > -------- EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management Up to > 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > > -- View this message in context: http://old.nabble.com/Sorting-by-non-property-article-name-as-second-criteri on-tp32324423p32331453.html Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev _______________________________________________ Semediawiki-user mailing list Sem...@li... https://lists.sourceforge.net/lists/listinfo/semediawiki-user |