Help:Embedded format

From semantic-mediawiki.org

Jump to: navigation, search

The result format embedded is used to embed the contents of the pages in a query result into a page. The embedding uses MediaWiki transclusion (like when inserting a template), so the tags <includeonly> and <noinclude> work for controlling what is displayed.

Contents

Example

The following creates a list of recent news posted on this site (like in a blog):

{{#ask: [[News date::+]] [[language code::en]]
| sort=news date
| order=descending
| format=embedded
| embedformat=h3
| searchlabel= view older news
| limit=3
}}

This produces the following output:

Semantic MediaWiki 1.4.1 released

16 Dec 2008. With Semantic MediaWiki 1.4.1, the SMW Project provides a first minor update for SMW 1.4. The new version mainly fixes some open issues in the processing of Type:Date, removes some other minor problems, and provides extended translations. Upgrading from SMW 1.4.0 is as simple as replacing all SMW extension files with the new version's. Further information is found on the SMW 1.4.1 page.

Semantic MediaWiki 1.4.0 released: easier upgrade and installation, better date support, special property integration, more robust

Nov 21 2008. The SMW Project is happy to announce the release of the new Semantic MediaWiki 1.4.0. The new version introduces a number of new features and general improvements. Please be sure to read the installation and upgrade instructions before updating an existing wiki. Read more

SMW Project releases SMW 1.4 alpha for extension developers

Oct 26 2008. Version 1.4 of Semantic MediaWiki will largely unify the treatment of "special properties" (like has type) and normal user-defined properties. Both can be queried in essentially the same ways, and new "special" properties will be introduced to allow new features. Together with other required clean-ups, this brings some changes for developers using SMW for their own extensions. To help extension developers in producing compatible updates for their software, the SMW Project releases an alpha version of SMW 1.4 which already includes all major internal API modifications. While many details changed their appearance, upgrading code to SMW 1.4 should in many cases boil down to some search and replace of small code pieces. Details will be discussed on the developer mailing list
[view older news]

Note that a newline (<br>) is used to put the further results link on a separate line.

Parameters

The embedded format introduces the following additional parameters:

  • embedformat: this defines which kinds of headings to use when pages are embedded, may be a heading level, i.e. one of h1, h2, h3, h3, h4, h5, h6, or a description of a list format, i.e. one of ul and ol
  • embedonly: if this parameter has any value (e.g. «true»), then no headings are used for the embedded pages at all.

Remarks

Note that embedding pages may accidently include category statements if the embedded articles have any categories. Use <noinclude> to prevent this, e.g. by writing

<noinclude>[[Category:News feed]]</noinclude>

SMW will take care that embedded articles do not import their semantic annotations, so these need not be treated specifically.

Also note that printout statements have no effect on embedding queries.

This documentation page applies to all SMW versions from 0.7 to the most current version.
     

Help:Embedded format en 0.7

Personal tools