<tpl:Widget>

Allows to display a widget outside of the customizable sidebars available in the admin interface.

The <tpl:Widget> tag has only one attribute id and one content including one or several setting tags. Each setting tag has a mandatory name attribute and a content.

To add a widget in your template, you can use something like this:

<tpl:Widget id="Widget identifier">
  <setting name="Parameter name">Parameter value</setting>
  ...
</tpl:Widget>

The list of parameters for this tag is available in the widgets admin page online help, and depends on the plug-ins you have installed.

Note:

The widget is automatically put in a <div> block. In most of the cases, a class attribute corresponding to the widget id is added to this block. Sometimes, this class attribute might not match (e.g. for a widget replacing a default widget). It is therefore necessary to check the HTML result to control the value of the attribute.

Examples

Selected articles

<!-- # Selected articles -->
<tpl:Widget id="bestof">
	<setting name="title">Selected articles</setting> <!-- # Title : (text) -->
	<setting name="orderby">asc</setting> <!-- # Sorting: (list), authorized values: (asc|desc) -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
</tpl:Widget>

Last articles

<!-- # Last articles -->
<tpl:Widget id="lastposts">
	<setting name="title">Last articles</setting> <!-- # Title: (text) -->
	<setting name="category"></setting> <!-- # Category: (list), authorized values: (|null) -->
	<setting name="limit">10</setting> <!-- # Maximum number of articles: (text) -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
</tpl:Widget>

Last comments

<!-- # Last comments -->
<tpl:Widget id="lastcomments">
	<setting name="title">Last comments</setting> <!-- # Title: (text) -->
	<setting name="limit">10</setting> <!-- # Maximum number of comments: (text) -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
</tpl:Widget>

Blog languages

<!-- # Blog languages -->
<tpl:Widget id="langs">
	<setting name="title">Languages</setting> <!-- # Title: (text) -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
</tpl:Widget>

Newsfeed reader

<!-- # Newsfeed reader -->
<tpl:Widget id="feed">
	<setting name="title">Elsewhere</setting> <!-- # Title: (text) -->
	<setting name="url">http://fr.dotclear.org/blog/feed/atom</setting> <!-- # feed URL (text) -->
	<setting name="limit">10</setting> <!-- # Maximu number of posts: (text) -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
</tpl:Widget>
<!-- # Links -->
<tpl:Widget id="links">
	<setting name="title">Links</setting> <!-- # Title: (text) -->
	<setting name="category"></setting> <!-- # Category (list), authorized values: () -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
</tpl:Widget>
<!-- # Subscription links -->
<tpl:Widget id="subscribe">
	<setting name="title">Subscribe</setting> <!-- # Title: (text) -->
	<setting name="type">atom</setting> <!-- # Feed types : (list), authorized values: (atom|rss2) -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
</tpl:Widget>
<!-- # Navigation links -->
<tpl:Widget id="navigation">
	<setting name="title">Navigation</setting> <!-- # Title: (text) -->
</tpl:Widget>

List of categories

<!-- # List of categories -->
<tpl:Widget id="categories">
	<setting name="title">Categories</setting> <!-- # Title: (text) -->
	<setting name="postcount">0</setting> <!-- # Display the number of posts (boolean), authorized values: (0|1) -->
</tpl:Widget>

Search engine

<!-- # Search engine -->
<tpl:Widget id="search">
	<setting name="title">Search</setting> <!-- # Title: (text) -->
</tpl:Widget>

Pages

<!-- # Pages -->
<tpl:Widget id="pages">
	<setting name="title">Pages</setting> <!-- # Title: (text) -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
	<setting name="sortby">post_dt</setting> <!-- # Sort by: (list), authorized values: (post_title|post_position|post_dt) -->
	<setting name="orderby">asc</setting> <!-- # Order by: (list), authorized values: (asc|desc) -->
</tpl:Widget>

Text

<!-- # Text -->
<tpl:Widget id="text">
	<setting name="title">Titre</setting> <!-- # Title: (text) -->
	<setting name="text">Text</setting> <!-- # Text: (text) -->
	<setting name="homeonly">0</setting> <!-- # Homepage only (boolean), authorized values: (0|1) -->
</tpl:Widget>

Wiki powered by Dokuwiki.