On Donnerstag, 29. Mai 2008, Rolf Lampa wrote:
Markus Krötzsch wrote:
SystemSettings:
------------------------------------
* [[Company_name::<name>]]
* [[Founded_in::<year>]]
* etc.
[[Category:SystemSettings]]
------------------------------------
Now, from another page I'd like to retrieve and display the
value of the property SystemSettings->Company_name, using a
template for formatting, like so (somehow asking for the
value, I don't know how though...):
------------------------------------
{{get property value|companyname=
{{#ask: ...<single settings page> and its
property <company name?>...
}}
}}
{{#ask: [[Some page name]] | ?Company name }}
will do the trick. This should be documented at
semantic-mediawiki.org,
but I am happy about hints on improving the docu.
(
http://semantic-mediawiki.org/wiki/Help:User_manual is down again...)
Well, this does not really do the trick. For some reason this query
returns both the value AND a link to the property Type (!). The
following example:
{{#ask: [[SystemSettings]] | ?Quality standard }}
... returns this parsed HTML:
<a href="/wiki/Property:Quality_standard" title="Property:Quality
standard">Quality standard</a> BRC
But, what I want is only the value, which in this case is simply the
text "BRC" and nothing more.
You can change the text used for property labels using =, e.g.
{{#ask: [[SystemSettings]] | ?Quality standard = QS}}
and especially (in list output format), you can also hide single properties by
changing their label to an empty text:
{{#ask: [[SystemSettings]] | ?Quality standard = }}
If you want to hide all property labels, there is also the option
headers=hide, that has the same effect in your case:
{{#ask: [[SystemSettings]] | ?Quality standard | headers=hide }}
(The effect is different e.g. for table format, because setting a label to the
empty text in a table will not remove the table headers).
-- Markus
Since the server
http://semantic-mediawiki.org with the page
Help:User_manual is down again, I can't read the documentation for
further details about any parameters or whatever which possibly could
make the answer less verbose. However, I think that "default results"
should return only the miminum of the result you'ld expect.
Regards,
// Rolf Lampa
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
--
Markus Krötzsch
Institut AIFB, Universität Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362 fax +49 (0)721 608 5998
mak(a)aifb.uni-karlsruhe.de www
http://korrekt.org