Site for researching all meanings of Hebrew Bible.

Changes

Jump to: navigation, search

Help:Embedding wikilogs

5,137 bytes added, 18:28, 5 November 2014
Imported Wikilog documentation
{{Wikilog user manual header|advanced}}

It is possible to embed a list of wikilog articles in other wiki pages. Any listing that may be generated by [[Help:Special:Wikilog|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 [[Help:Special:Wikilog|Special:Wikilog]] as a template call to any wiki page. The syntax is very similar to simple wiki link, except that <code><nowiki>[[...]]</nowiki></code> brackets are replaced by <code><nowiki>{{...}}</nowiki></code> 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:

'''<nowiki>{{</nowiki>Special:Wikilog'''/Category:History/5'''<nowiki>}}</nowiki>'''

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 [[Help:Templates|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'':

<nowiki>{{</nowiki>Special:Wikilog/User:John Smith/'''Template:WikilogTempl1'''<nowiki>}}</nowiki>

The following parameters are provided to the template:

{| class="wikitable" width="100%"
|- style="vertical-align: top;"
! Template parameter
! Contents
|-
| '''class'''
| A list of HTML classes that are suggested to be applied to a <code><nowiki><div></nowiki></code> block around the list fragment. It allows the article entry to be globally styled (see [[Help:Wikilog styling|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 <code>[[Help:Extension:ParserFunctions##if:|<nowiki>{{#if:...}}</nowiki>]]</code> parser function.
|-
| '''date'''
| The article publication date. This is the date that the article was signed, which is the first argument to the <code><nowiki>{{wl-publish:...}}</nowiki></code> parser function call.
|-
| '''time'''
| The article publication time. This is the time that the article was signed, which is the first argument to the <code><nowiki>{{wl-publish:...}}</nowiki></code> parser function call.
|-
| '''tz'''
| Timezone information for the article publication date/time.
|-
| '''updatedDate'''
| The date the article was last edited.
|-
| '''updatedTime'''
| The time the article was last edited.
|-
| '''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 <code>[[Help:Extension:ParserFunctions##if:|<nowiki>{{#if:...}}</nowiki>]]</code> parser function.
|-
| '''summary'''
| The article summary.
|-
| '''comments'''
| A link to the article comments page. The link text states how many comments are there.
|}

=== Template examples ===

{| class="wikitable" width="100%"
|-
! Template markup
! Result
|-
|
<pre>
<div class="{{{class}}}">
'''[[{{{page}}}|{{{title}}}]]'''
<blockquote>
{{{summary}}}
<p><small>-- {{{authors}}}, {{{time}}}, {{{date}}}.</small></p>
</blockquote>
</div>
</pre>
| [[Image:Wikilog template example 1.png]]
|-
|
<pre>
<div class="{{{class}}}" style="background: #FFFFEE;
border: 1px solid #CCCC99; margin: 1px;">
<ul>
<li>'''Title:''' [[{{{page}}}|{{{title}}}]]</li>
<li>'''Wikilog:''' [[{{{wikilogPage}}}|{{{wikilogTitle}}}]]</li>
<li>'''Authors:''' {{{authors}}}</li>
<li>'''Published:''' {{{time}}}, {{{date}}}</li>
<li>'''Summary:''' {{{summary}}}</li>
<li>'''Comments:''' {{{comments}}}</li>
</ul>
</div>
</pre>
| [[Image:Wikilog template example 2.png]]
|}

{{Wikilog user manual footer}}
Anonymous user

Navigation menu