-
- How to Add a User to a Joomla Group Programmatically
- How to Send Emails in Joomla with PHP
- How to Connect to an External Database in Joomla with PHP
- How to Check If the Current User is Super User in Joomla with PHP
- How to Check if the Current Page Is the Homepage in Joomla with PHP
- How to Create a User Account in Joomla with PHP
- How to Create an Article in Joomla with PHP
- PHP Scripts Collection
Article
Use the {article} Smart Tags to show any article's title, text, images, link, category, author, or custom fields, from the current article or by ID.
Use the {article} Smart Tags to retrieve information about a Joomla article. This Smart Tag can return the value of any property from the Joomla Article object, including custom fields, as long as you know the property's name. It can access details from the article being viewed and from any article by providing the article's ID using the --id option.
{article.PROPERTY [--id=ARTICLE_ID]}
Replace PROPERTY with the name of the property from the article's object. To pull the property from a specific article, provide the --id option and replace ARTICLE_ID with the article's ID. Omit the --id option to use the article being viewed.
Below is a list of this category's most popular Smart Tags.
{article.id}
Returns the ID of the article.
{article.title}
Returns the title of the article.
{article.introtext}
Returns the intro of the article.
{article.fulltext}
Returns the complete text of the article.
{article.images.image_intro}
Returns the intro image of the article.
{article.images.image_fulltext}
Returns the full text image of the article.
{article.alias}
Returns the alias of the article.
{article.link}
Returns the relative SEF URL of the article, e.g. /blog/my-article.
{article.category}
Returns information about the category the article belongs to, such as its title or description. This Smart Tag can return the value of any category property as long as you know the property's name.
- {article.category.title}: the title of the category.
- {article.category.alias}: the alias of the category.
- {article.category.description}: the category description.
- {article.category.path}: the category path, such as news/press-releases.
- {article.category.id}: the category ID, same as {article.catid}.
{article.user}
Returns information about the article's author, such as the name, email address, or even a custom field. This Smart Tag can return the value of any property from the Joomla User object as long as you know the property's name. This property mimics the behavior of the User Account Smart Tags.
For instance, to retrieve the author's ID, use:
{article.user.id}
To return the author's name, use the following:
{article.user.name}
To retrieve an author's custom field value, use:
{article.user.field.FIELDNAME}
Custom Fields
To output a custom field value associated with the article, use:
{article.field.NAME}
Replace NAME with the name (not the label) of your custom field. For instance, if you have a custom field named favoriteColor:
{article.field.favoriteColor}
You can access additional properties of a custom field by appending the appropriate property name after the field name.
{article.field.NAME.rawvalue}
{article.field.NAME.id}
For advanced usage, including subforms, field labels and disabling content plugins, check the full guide: Using Custom Fields in Smart Tags.