The tag {{tpl:EntryFirstImage}}
shows only the first image of an entry and it's used in the template tag <tpl:Entries>
. If there is no image found, this tag can show the first image of the description for the category belonging to an entry. (see also with_category ci-dessous).
Note:
Only images in the media organizer can be used for this tag.The attribute size allows to display an image accurate to its size. It accepts five values 1) :
By default, an image is displayed in small format.
The attribute class adds the class CSS to an image, that allows you to personalize its style in your style.css.
By default, if there is no image found in your entry, there is no image shown.
If you want to force showing an image by default, however, there is no image to a particular entry, you can choose the option with_category="1"
. In this case, if an entry doesn't contain any image, the image will be that of your category according to your category description.
By default, image is displayed within an img tag. If you wish to retrieve only its URL, you may use the option no_tag = "1"
.
By default, the image is retrieved from the post's abstract and content. If you wish to extract the image from the content only, use the option content_only = "1"
.
By default, the image is retrieved from current post. If you wish to extract the image from post's category description, use the option cat_only = "1"
.
<tpl:Entries> {{tpl:EntryFirstImage size="sq" class="left" with_category="1"}} <h2>{{tpl:EntryTitle encode_html="1"}}</h2> <br style="clear:both;" /> </tpl:Entries>
This code shows a list of entries with an image in format miniature on the left side if the title. If this entry doesn't have an image, the first image of your category will be shown (if it exists).
Wiki powered by Dokuwiki.