<tpl:Entries>

The tag tpl:Entries displays a list with entries in many different combinations. The simplest of it is showing the last entry always in its context. For example, in the page listed a category, a simple appeal to this tag will limit the list of the category tickets.

Attribute

lastn

This attribute permits the limitation in number of entries. If no value has been given the number of entries are the same as in the default settings. Using a value 0 lists all entries.

Important:

The value 0 does not really display all entries. It is possible to set a projected number, for example 1000 in order to show all entries. (cf. ce ticket)

sortby

By default, entries are listed in their inverse chronological order. This attribute allows to choose following values by default :

  • title : sort by title
  • selected : sort by status "selected"
  • author : sort by author
  • date : sort by date
  • id : sort by ID of entry

order

This attribute allows to specify the order for displayed entries. Possible values are asc (ascendant) and desc (descendant).

type

This attribute allows to specify the type of content. In fact, Dotclear can deal different type of content. For example, the plugin Pages adds a new type page, which allows to add pages to a blog. Entries are normally type post.

If this attribute is not specified, the default type is set to post.

url

This attribute allows to specify an unique entry identified through its URL.

author

This attribute allows to filter exclusively the entries of a particular user. The value to be entered is the user identifier (log-in name).

category

This attribute allows to select entries by categories. You may select several categories or exclude other ones by means of '?not'. Categories are identified by their URL.

In the following example there is a selection of entries for the category "Histoires":

<tpl:Entries category="Histoires">

If you want that an entry belongs to categories "Histoires" or "Nouvelles" :

<tpl:Entries category="Histoires,Nouvelles">

Finally, if you don't want to display both categories "Histoires" and "Nouvelles" :

<tpl:Entries category="Histoires ?not,Nouvelles ?not">

NEW This attribute allows also to specify if you want to obtain the entries of a categorye and its sub-category. Following example shows entries in the category "Histoires" and its eventual sub-categorie:

<tpl:Entries category="Histoire ?sub">

It is possible to combine the marks ?not and ?sub in order to exclude a category and its sub-category.

NEW Finally, the identification of the category #self permits to specify the current category. This can be used for displaying an entry of another category:

<tpl:Entries category="#self ?not" no_context="1">

Note that it is necessary to use this mark with attribute no_context="1".

no_category

This attribute permits to obtain entries without category. Its value is 0 or 1.

selected

This attribute allows to obtain entries with selection or not. If is value is set to 1, only selected entries will be shown. On the other side, if the value is set to 0, only not selected will be shown.

no_content

Using the with value 1, the entry's content is not accessible. This can be used for displaying lists if you only want to show the title of an entry.

ignore_pagination

In numerous cases (Home page, Category page, Tag etc.) a list of entries can have or require a pagination. The pagination itself is global and part of the template tag tpl:Entries. This attribute with its value 1 allows to ignore the pagination.

no_context

The template tag tpl:Entries takes into account the various filters imposed by the context. For instance, if this tag is inserted within a tag tpl:Categories, category filter will automatically be carried out. In the same way, this tag within the context of an archives page will screen the content by date.

This attribute which has got the value 1 does not allow to take filters into account.

tag

NEW This attribute allows to filter by tag name and works like the attribute category. The identification is the tag name (including spaces).

In the following example the selection of entries is relative to the tag "faune et flore" :

<tpl:Entries tag="faune et flore">

Examples

The last 15 entries by author "john"

<tpl:Entries lastn="15" author="john">

The entry tree sorted by title in alphabetical order

<tpl:Entries sortby="title" order="asc">

The last 3 entries of each category in a blog

<tpl:Categories>
  <h2>{{tpl:CategoryTitle}}</h2>
  <tpl:Entries lastn="3">
    <p>{{tpl:EntryTitle}}</p>
  </tpl:Entries>
</tpl:Categories>

All entry titles of a category and its sub-categories

<tpl:Entries category="#self ?sub" no_context="1">
    <p>{{tpl:EntryTitle}}</p>
</tpl:Entries>

Wiki powered by Dokuwiki.