init_article
Tag {init_article} can be used to call out one article with defined ID.
Parameters
- id - ID number of the article to return. If ID is not defined in tag, current page ID is used.
- name - variable name where the returned data is saved. Default value is "article".
- buttons - defines which action buttons are displayed to the site editor. Values can be "new,edit,hide,move,delete".
- metadata - defines the metadata ID. Only used when metadata sets exist in a database.
This functionality is deprecated in version 4, please use profiles instead. - on_create - comma separated statements for new articles:
- publish: allows to publish all articles immediately. If the parameter has value "publish", then a created article is published immediately after saving. 4.0.2
- allow_comments: ticks the check box for allowing comments in the article editor when creating a new article. 4.5.3
Examples: on_create="publish" or on_create="publish, allow_comments" or on_create="allow_comments". - system_message - alias of the system article to return, eg system_message="404error". 3.5.4 4.1.0
Attributes
- id - ID number of the article
- parent_id - ID number of parent object
- href - link to the article detailed view, eg ?id= 368
- title - title of the article
- lead - lead part of the article
- body - body part of the article
- is_selected - value is 1 in case of active article, 0 otherwise
- buttons - action-buttons, available only for editors.
- date - date of the article, can be changed in article's editor.
- fdate - date of the article in database default format, eg yyyy-mm-dd. 4.0.8
- datetime - date and time of the article, format dd.mm.yyyy hh:mm. 4.4.1
- fdatetime - date and time of the article in database format, eg yyyy-mm-dd hh:mm:ss. 4.4.1
- details_link - alias to "href" attribute.
- details_title - link title to the article detailed view (system word).
- printgif - link to the print view of the article with small printer-icon.
- printlink - link to the print view of the article.
- comment_link - link to the comment board of an article.
- comment_title - title of the link to the comment board of an article (system word).
- add_comment_link - hyperlink to the "add comment" form.
- add_comment_title - title of the link to the "add comment" form.
- comment_count - the number of comments in comment board.
- forum_allowed - value is 1 if forum is allowed for the article, 0 otherwise. Example: {if obj->forum_allowed == 0} Forum is not allowed {/if}.
- show_headline - value is 1 if headline is visible for the article, 0 otherwise.
- author - author of the article.
- last_modified - object's last modified time, filled automatically by the system.
This functionality is deprecated in version 4, please use changed_time instead. - class - class name of the object. The possible values for {$obj->class} are: "section, article, link, image, comment, poll, document, article's list, link list, login-box, subject, album, iframe-box, event".
- category - article keyword as a text. Has value only if metadata ID=2003.
This functionality is deprecated in version 4, please use profiles instead - hit_count - page load count of the article.
- prev_id and next_id - ID numbers of the previous/next article based on the sort order.
- <attribute> - returns data field value of the profile. All attribute-value pairs of the article can be called out by the name of the attribute. The data field name is defined in the administration area of the site. Note: don't use the translations of the data field names. 3.3.8
- created_user_id - user ID who initially created the object. 4.0.3
- created_user_name - user full name who initially created the object. 4.0.3
- changed_user_id - user ID who made the last object saving. 4.0.3
- changed_user_name - user full name who made the last object saving. 4.0.3
- created_time - creating time of the object in format dd.mm.yyyy hh:ii. 4.0.3
- fcreated_time - creating time of the object in database default format, eg yyyy-mm-dd hh:ii. 4.0.3
- changed_time - last saving time of the object in format dd.mm.yyyy hh:ii. 4.0.3
- fchanged_time - last saving time of the object in database default format, eg yyyy-mm-dd hh:ii. 4.0.3
- comment_count - the number of comments. 3.3.13 4.0.6
- last_commented_time - the last comment time in format dd.mm.yyyy hh:ii. 4.0.6
Examples
{* Init_article within init_articles loop *}
{init_articles name="articles"}
{foreach from=$articles item="article"}
{init_article id=$article->id name="article_details"}
{$article->buttons}
{if $article->show_headline == 1}
<h1>{$article->title}</h1>
{/if}
<p>{$article_details->lead}</p>
<p>{$article_details->body}</p>
{foreachelse}
{$articles_newbutton}
{/foreach}
RSS