Справка:Embedding wikilogs
User Manual |
|
It is possible to embed a list of wikilog articles in other wiki pages. Any listing that may be generated by Special:Wikilog can also be embedded like a template in other wiki pages.
This has many interesting uses:
- In the front page of the wiki, a list of the latest wikilog articles.
- In users pages, a list of that user's wikilog articles in all wikilogs.
Simple embedding
Simple embedding is possible by adding Special:Wikilog as a template call to any wiki page. The syntax is very similar to simple wiki link, except that [[...]]
brackets are replaced by {{...}}
braces.
For example, to embed a list of the last five articles from all wikilogs filled in the History category in the current page, this markup must be added:
{{Special:Wikilog/Category:History/5}}
Articles are formatted like in Special:Wikilog page itself, except that the query form isn't shown and no navigation links are provided, only the last articles are listed.
When including or embedding a list of wikilog articles in another page, it may be desired to have the articles presented in a different format, more visually suitable for the page it is being embedded to. In this case, templated embedding is possible.
Templated embedding
By providing a template name to Special:Wikilog, the article listing will be formatted according to the provided template. Wikilog loads the template and expands it once for each article, filling its parameters with data from the articles.
For example, to embed a list of wikilog articles from the user John Smith using the template WikilogTempl1:
{{Special:Wikilog/User:John Smith/Template:WikilogTempl1}}
The following parameters are provided to the template:
Template parameter | Contents |
---|---|
class | A list of HTML classes that are suggested to be applied to a <div> block around the list fragment. It allows the article entry to be globally styled (see styling). It is a list of one or more of: "wl-entry" and "wl-draft".
|
wikilogTitle | The title of the wikilog where the article is published, without the namespace prefix. Suitable for presentation. |
wikilogPage | The full page title of the wikilog where the article is published. Suitable for wikilinking. |
title | The article title. Suitable for presentation. |
page | The full page title of the article. Suitable for wikilinking. |
authors | One or more authors of the article. |
tags | Comma-separated list of article tags. |
published | Whether the article was published or still a draft. An asterisk is returned if the article was published, otherwise the parameter is blank. This is designed to be used with the {{#if:...}} parser function.
|
pubdate | The article publication date and time. This is the date that the article was signed, which is the first argument to the {{wl-publish:...}} parser function call. Deprecated since Wikilog 1.0.1, use 'date' and 'time' instead.
|
date | The article publication date. This is the date that the article was signed, which is the first argument to the {{wl-publish:...}} parser function call. Available since Wikilog 1.0.1.
|
time | The article publication time. This is the time that the article was signed, which is the first argument to the {{wl-publish:...}} parser function call. Available since Wikilog 1.0.1.
|
updated | The date and time the article was last edited. Deprecated since Wikilog 1.0.1, use 'updatedDate' and 'updatedTime' instead. |
updatedDate | The date the article was last edited. Available since Wikilog 1.0.1. |
updatedTime | The time the article was last edited. Available since Wikilog 1.0.1. |
hasMore | Whether the article has more text than provided by 'summary'. An asterisk is returned if the article contains more text, otherwise the parameter is blank. This is designed to be used with the {{#if:...}} parser function. Available since Wikilog 1.0.1.
|
summary | The article summary. |
comments | A link to the article comments page. The link text states how many comments are there. |
Template examples
This page is part of the Wikilog extension user manual, which is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. The original text is available at the extension site. |