1

I want to embed the result of an ask query on a page in Semantic MediaWiki. The result column has the type Url as in [[Has type:Url]]. However, when embedding the code I would like to show the URL not explicitly since it is very long but as a fixed string (e.g. "Website" )as I would have typed: [https://someURL.com Website]

I tried to set the name on the page in the property assignment itself by including:

[[Has website::https://someURL.com | Website]]

This is the basic structure of an example query.

{{#ask: [[Has website_example::true]]
 |?Has website
 |format=table
 |limit=50 |offset=0
 |link=all
 |sort=
 |order=asc
 |headers=show
 |searchlabel=... further results
 |class=sortable wikitable smwtable
}}

Is it possible to render the ?Has website as a link with the text "Website" in the table?

Wald3n
  • 133
  • 1
  • 10

1 Answers1

2

You may be have to pass through a 'template' format, and reconstruct your rows based on this template.

Example :

|-
! [{{{1}}} | Website]

then just surround your 'ask' request by table headers and footers.

Camille
  • 151
  • 5
  • Thank you, the format templates are what I need. Is it possible to apply templates only to one part of the ask query output? When I have more columns than only the website I would like to apply a template only to the website part and leave the rest as it is. I know how to do it completely within one template but I would like to concentrate only on the subpart. – Wald3n Sep 26 '19 at 09:08
  • Please add your question to the original question or create a new question. Template result handling is described at https://www.semantic-mediawiki.org/wiki/Help:Template_format – Wolfgang Fahl Sep 27 '19 at 12:07