Semantic Mediawiki: Sorting Values ​​by Date

As in this thread, I want to order the values ​​by date. I am using code

[[Einspiel_{{{1}}}::{{{2}}}| ]]{{{2}}}

      

in the template to easily pass the value of the variable. {{{1}}} is the name of my variable and {{{2}}} is the date (dd.mm.yyyy).

How can I give a variable multiple values, I want to get the highest date on another wiki page.

I tried it with something like this

{{#arraydefine:{{{1}}}_Preisdatum
  |{{#ask:[[Kategorie:Aktualisierungen]]
      |?Einspiel_{{{1}}}=
      |mainlabel=-
      |link=none
      |sort=Einspiel_{{{1}}}
      |order=desc}}
    }}
{{#arrayindex:{{{1}}}_Preisdatum|0 }}

      

but without success. The problem is that dates are only ordered by the first digit. If I try to get a top-down list, the result is:

  • 11.07.2014
  • 07/08/2014
  • 01.01.2015

instead

  • 01.01.2015
  • 11.07.2014
  • 07/08/2014

I've read that there is a way to specify C # SORTKEY dates , but I don't know how to include that in my code as my input only needs to be the newest date. Hope you guys can help me. Thanks in advance.

+3


source to share


2 answers


I do not know how many properties you have Einspiel_{{{1}}}

, but you need to create related pages (ie Template:Einspiel_One

, Template:Einspiel_Two

, Template:Einspiel_Three

, etc.).

And in each of them, you have to specify the data type of this property by adding the property type with. If you don't, Mediawiki doesn't know that this property is a date, and it won't sort it accordingly.

Example

In Template:Einspiel_One

:

This is my first property...
[[Has type::Date]]

      



In Template:Einspiel_Two

:

This is my second property...
[[Has type::Date]]

      

In Template:Einspiel_Three

:

This is my thrid property...
[[Has type::Date]]

      

Etc...

0


source


I think Thibault was wrong in his answer - there is no point in creating "Template: ..." because property types are stored in the "Property: ..." namespace. However, there seems to be no solution for you other than coding your own Result format



0


source







All Articles