article image
From Textbook
<txp:article_image />
The article_image tag is a single tag. Textpattern will replace this tag with the <img src="..." /> HTML tag matching the numeric ID or URL assigned when the article is posted.
The image to be associated with the tag is set under the Write tab. Click "Advanced Options" and enter either the URL of the image, or the Textpattern ID (a number set by Textpattern at upload) into the Article image field. Most of the time you will use the image ID here. Note that you can only assign a single image to each article.
Contents |
Attributes
Tag will accept the following attributes (case-sensitive):
- thumbnail="boolean"
- Use the thumbnail rather than full-size image.
- Values:
1(yes) or0(no). - Default:
0. - escape="html"
- Escape HTML entities such as
<,>and&for the image'saltandtitleattributes. - Value:
htmlor unset. - Default:
html. - wraptag="tag"
- HTML tag to be used to wrap the
imgtag, specified without brackets. - Default: unset.
- class="class name"
- CSS
classattribute to apply to the image (or to the wraptag, if set). - Default: unset.
- html_id="id"
- The HTML
idattribute assigned to the image (or to the wraptag, if set). - Default: unset.
- style="style rule"
- Inline CSS style rule.
- Default: unset.
- aligndeprecated="HTML value"
- HTML
alignattribute for theimgtag. Recommended that you use CSS viaclassorhtml_idattribute instead. - Default: unset.
Examples
Example 1: Use wraptag and class for styling
<txp:article_image wraptag="p" class="article-image" />
- What this does...
- This will wrap the image in paragraph tags, applying the class to the paragraph:
<p class="article-image"><img src="..." /></p>. - Why you might do it...
- It gives you full control over the image's appearance using CSS.
- Note
- Without the wraptag, the class is applied directly to the
imgtag
Example 2: Link thumbnail to the article
Used in an article list form this will display an article list consisting of hyperlinked article images' thumbnails.
<txp:permlink><txp:article_image thumbnail="1" /></txp:permlink>
Other tags used: permlink
Genealogy
Version 4.2.0
- attribute
aligndeprecated
Version 4.0.7
- default value for attribute
escapechanged from unset tohtml
Version 4.0.4
-
class,escape,html_id,thumbnail, andwraptagadded.




