After you have defined what article or articles you want to show, you can tell Articles Anywhere what article data you want to output to the page.
If you place nothing between the opening and ending tags, the full article will be placed:
{article title="Shetland Sheepdog"}{/article}
However, you will probably only want certain types of data to show, like only the text or only the title.
To define what data you want to get displayed, you place "Data Tags" within the {article}
and {/article}
tags.
For instance, to show only the title of the article with id 123, you can do:
{article id="123"}[title]{/article}
You can display a huge range of data types, including any article data, category data, dates, and even custom field values and dynamic data - pretty much anything you can think of.
Let’s take an in-depth look at the Data Tags available and their respective options and features.
This is a full list overview of all the data types you can use as Filters, Ordering, Data Tags and inside If Structures with Articles Anywhere. Remember:
- When you want to output the data (Data Tags), you need to surround them with square brackets - for example:
[title]
. - When using these in all other cases (filters, ordering and If structures), then they must be used without the square brackets - for example:
{if title != 'Furry Animals'}...{/if}
.
Refer to the respective sections of the documentation for the full explanation and details on how to use each of these.
Tip: Data types that return True / False values are especially useful to do custom checks with If Structures.
Article Data
Syntax | Example | Description |
---|---|---|
article | Show Example | The entire article as displayed in the article view. See the Full Article section for a full explanation. |
title | Apples | The title of the article. |
alias | apples | The alias of the article. |
id | 12 | The ID of the article. |
text introtext fulltext | Show Example | The full text or the intro text of the article. See the Text section for a full explanation. |
category | Fruit | The category that the article belongs to.
|
author | Peter Van Westen | The author of the article (the "Created by" user). A lot more category data is available with author:... - see the User Data below for more details. |
modifier | Andy | The article modifier (the "Modified by" user). A lot more category data is available with modifier:... - see the User Data below for more details. |
image-intro | The intro image of the article. A lot more image data is available - see the Images & Videos section below for more details. | |
image-fulltext | The full article of the article. A lot more image data is available - see the Images & Videos section below for more details. | |
is-published | true | A true/false value based on whether the article is published or not. This also takes into account the publish-up and publish-down dates. |
created publish-up publish-down modified | Wednesday, 5 February 2020 16:00 | The create, publish and modify dates. The date format can be customized. See the Dates section for a full explanation. |
is-featured | false | A true/false value based on whether the article is set as featured or not. This also takes into account the featured-up and featured-down dates. |
featured-up featured-down | Monday, 15 June 2020 19:00 | The featured up and down dates (If the article is set as featured). The date format can be customized. See the Dates section for a full explanation. |
has-access | true | A true/false value based on whether the visitor/logged-in user has access to the article. |
ordering | 5 | The ordering position of the article in the "Articles" manager. |
featured-ordering | 3 | The ordering position of the article in the "Featured Articles" manager (If the article is set as featured). |
hits | 712 | The number of views that the article received. |
url | /fruit/apples | The URL to the article (you can also use sefurl in special cases). |
[link]...[/link] | Apples | Opening and closing tag to add a link to the article (wraps the content with an a href tag). |
[readmore] | Read more: Apples | A "read more" button that links to the full article. See the Read more section for a full explanation. |
[edit] PRO | Edit | A link to the article editing page. See the Edit Link section for a full explanation. |
tags PRO | The tags attached to the article. See the Tags section for a full explanation. | |
my-custom-field PRO | Green | The value of any Custom Field attached to the article. Use the name of the desired field, for example: [color] .A lot more custom field data is available - see the Custom Fields section for a full explanation. |
language metadesc metakey etc. | ... | Any other article data. It must match the name of the columns available in the database. |
meta-robots meta-author meta-rights etc. | ... | Any attribute related to the Meta Data. It must match the attribute name in the metadata database column and must be prefixed with meta- |
urla urlb urlc etc. | ... | Any attribute related to the links from the "Images and Links" tab. It must match the attribute name in the urls database column. |
show_title show_category show_author etc. | true | Any attribute related to "Options" tab. It must match the attribute name in the attribs database column (you can replace the underscores with dashes). These can be particularly useful in If Structures. |
See the Article Data section for a full explanation and more details.
Category Data
Syntax | Example | Description |
---|---|---|
category or category:title | Fruit | The title of the category. |
category:id or catid | 4 | The ID of the category. |
category:alias | fruit | The alias of the category. |
category:description | This category includes fruit. | The description text of the category. |
category:ordering | 7 | The ordering position of the category in the "Category" manager. |
category:image PRO | The image of the category. See the Images section for a full explanation and more details. | |
category:url PRO | /fruit/ | The URL to the category (you can also use category:sefurl in special cases). |
[category:link]...[/category:link] PRO | Fruit | Opening and closing tag to add a link to the category (wraps the content with an a href tag). |
category:is-published | true | A true/false value based on whether the category is published or not. |
category:has-access | true | A true/false value based on whether the visitor/logged-in user has access to the category. |
category:language category:metadesc category:metakey etc. | ... | Any other category data. It must match the name of the columns available in the database. |
category:meta-robots category:meta-author etc. | ... | Any attribute related to the Meta Data. It must match the attribute name in the metadata database column and must be prefixed with meta- |
category:category_layout category:image_alt etc. | ... | Any attribute related to "Options" tab. It must match the attribute name in the params database column (you can replace the underscores with dashes). |
The same exact data can also be output for the Parent Category of an article, by using parent-category
instead of category
.
See the Category Data section for a full explanation and more details.
User Data J4
Syntax | Example | Description |
---|---|---|
author | Peter | The name of the author of the article. If set, the "Created by Alias" will take precedence over the name of the user. |
author:name | Peter Van Westen | The name of the user that is the author of the article (the "Created by" user). |
author:id author:username author:email | peter | The ID, username and email of the author of the article (the "Created by" user). |
author:id-alias | Peter | The alias set in the "Created by Alias" field of the article. |
author:registerDate author:timezone author:lastvisitDate etc. | 2020-11-08 19:07:00 | Any other user data of the author. It must match the name of columns or attributes available in the database. |
modifier or modifier:name | Andy | The name of the article modifier (the "Modified by" user). |
modifier:id modifier:username modifier:email . | andy | The ID, username and email of the article modifier (the "Modified by" user). |
modifier:registerDate modifier:timezone modifier:lastvisitDate etc. | 2020-11-08 19:07:00 | Any other user data of the modifier. It must match the name of columns or attributes available in the database. |
user:id PRO | 465 | The ID of the currently logged-in user (visitor of the page). This will be 0 if the visitor is not logged in. |
| Peter Van Westen, peter | The name, username and email of the currently logged-in user (visitor of the page). |
user:guest PRO | false | A true/false value based on whether the current visitor is a guest (true) or is logged-in (false). |
user:registerDate user:timezone user:lastvisitDate etc. PRO | 2020-11-08 19:07:00 | Any other user data of the logged-in user. It must match the name of columns or attributes available in the database. |
See the User Data section for a full explanation and more details.
Images
Syntax | Example | Description |
---|---|---|
image-intro | The intro image of the article. | |
image-intro:url | /images/fruit/apples_s.jpg | The URL of the intro image. |
image-intro:alt image-intro:caption image-intro:float | Apples | Any attribute related to the intro image. |
image-fulltext | The full article image of the article. | |
image-fulltext:url | /images/fruit/apples_full.jpg | The URL of the full article image. |
image-fulltext:alt image-fulltext:caption image-fulltext:float | Apples Article | Any attribute related to the full article image. |
image-... PRO |
| The image by given number found inside the article text. For example image-2 to get the 2nd image found. |
image-1:width image-2:height image-3:alt etc. PRO | 200, 150, My Image | Any attribute related to the image found inside the article text by the given number. |
image-random PRO | To output a random image from the content of the article. | |
category:image PRO | The image of the category attached to the article. | |
category:image:url PRO | /images/fruit/bananas_s.jpg | The URL of the image of the category attached to the article. |
my-image-field PRO | The image from a Custom Field of type media . | |
youtube-1-thumb PRO | The thumbnail for the YouTube video by given number found inside the article text. For example [youtube-2-thumb] to get the thumbnail of the 2nd video found. |
See the Images section for a full explanation and more details on the images features. The Pro version of Articles Anywhere also has the ability to automatically create resized images (thumbnails) and much more.
Videos PRO
YouTube Videos
Syntax | Description |
---|---|
[youtube-1] | The first YouTube video found. To place the fifth video found in the content, use [youtube-5] . |
[youtube-random] | A random YouTube video found in the content. |
[youtube-...:url] | The url of these videos instead. This will output the url as you see it in the browser. |
[youtube-...:iframe-url] | The embed url for use in iframes. |
[youtube-...:short-url] | The short url (using the youtu.be domain). |
[youtube-...:id] | Only the id of the YouTube video. |
[youtube-...:link]...[/youtube-...:link] | Add a link to the YouTube video. |
[youtube-count] | The total number of YouTube videos found in the text. You can also use this value in the If Structures. |
Vimeo Videos
Syntax | Description |
---|---|
[vimeo-1] | The first Vimeo video found. To place the fifth video found in the content, use [vimeo-5] . |
[vimeo-random] | A random Vimeo video found in the content. |
[vimeo-...:url] | The url of these videos instead. This will output the url as you see it in the browser. |
[vimeo-...:iframe-url] | The embed url for use in iframes. |
[vimeo-...:id] | Only the id of the Vimeo video. |
[vimeo-...:link]...[/vimeo-...:link] | Add a link to the Vimeo video. |
[vimeo-count] | The total number of Vimeo videos found in the text. You can also use this value in the If Structures. |
See the Videos section for a full explanation and more details on how to output the videos contained in the article.
Custom Fields PRO
Syntax | Example | Description |
---|---|---|
habitat-area | Asia | The rendering of a custom field via its field layout, without the label.
|
habitat-area:text | Asia | Only the text value of a custom field, without any html markup around it. |
habitat-area:value | as | The rawvalue of a custom field, without any html markup around it. |
habitat-area:label | Habitat | The label of a custom field. |
habitat-area:title | Habitat Area | The title of a custom field. |
habitat-area:name | habitat-area | The name/alias of a custom field. |
habitat-area:id | 123 | The ID of a custom field. |
habitat-area:type habitat-area:description | list | The type, description, or any other data attached to the field. It must match the name of the columns available in the database (you can replace the underscores with dashes). |
habitat-area:render_class habitat-area:prefix habitat-area:suffix etc. | ... | Any attribute related to the field "Options". It must match the attribute name in the params or fieldparams database column (you can replace the underscores with dashes). |
Field Groups J4
Syntax | Description |
---|---|
[fieldgroup:5] | The full output of a fieldgroup based on the ID |
[fieldgroup:5:title] | The title of a fieldgroup based on the ID. |
[fieldgroup:5:description] | The description of a fieldgroup based on the ID. |
[fieldgroup:product-information] | The full output of a fieldgroup based on the Title, where the Title is "Product Information" |
[fieldgroup:product-information:description] | The description of a fieldgroup based on the Title, where the Title is "Product Information" |
See the Custom Fields section for a full explanation and more details.
Numbers PRO
In the following examples, let's say we're using Articles Anywhere with pagination, to show articles from the "Animals" category, which has a total of 75 articles. But we're only showing 10 articles per page, with an overall limit of 40:
{articles category="Animals" limit="40" per-page="10"}...{/articles}
Let's say we're looking at the 3rd article returned on the 2nd page (so the 13th article overall). This is what the Numbers output would result into:
Current Page Numbers
The following numbers data tags return the corresponding values for the articles displayed on the current page:
Syntax | Example | Description |
---|---|---|
total | 10 | The total number of articles returned on the page. This also equals to the count of the last article. |
count | 3 | The number of the current article in the list of articles on the page. |
previous | 2 | The number of the previous article on the page. This will return the number of the last article when the current is the first. |
next | 4 | The number of the next article on the page. This will return the number of the first article (1) when the current is the last. |
limit | 40 | The maximum number of articles set to be returned. |
offset | 0 | The offset when showing a range of articles not starting from the start. |
per-page | 10 | When using pagination, the number of articles per page set to be returned. |
pages | 4 | When using pagination, the number of pages generated by the results. |
page | 2 | When using pagination, the number of the current page. |
previous-page | 1 | The number of the previous page. This will return the number of the last page when the current is the first. |
next-page | 3 | The number of the next page. This will return the number of the first page (1) when the current is the last. |
is-current | false | A true or false value based on whether the current article is the article that contains the plugin tag itself. Equivalent to: {if id = this:id} |
is-first is-last | false / false | A true or false value based on whether the current article is the first/last in the list of articles on the page. |
is-even is-uneven | false / true | A true or false value based on whether the current article is an even/uneven article in the list of articles on the page. |
has-next has-previous | true / true | A true or false value based on whether there is a next/previous article on the page (so can be false for first/last articles). |
every-... | true | A true or false value based on the number of the article in the list of articles. For example every-3 . |
is-...-of-... | false | A true or false value based on the number of the article in the list of articles. For example is-2-of-5 . |
is-first-page is-last-page | false / false | When using pagination, a true or false value based on whether the current page is the first/last. |
has-next-page has-previous-page | true / true | When using pagination, a true or false value based on whether there is a next/previous page (so can be false for first/last pages). |
No-Pagination Numbers
The following numbers data tags return the corresponding values before pagination is applied. These will be different from the ones above only if pagination is used:
Syntax | Example | Description |
---|---|---|
total-no-pagination | 40 | The total number of articles before pagination is applied. This also equals to the count-no-pagination of the last article. |
count-no-pagination | 13 | The number of the current article in the list of articles, regardless of pagination. |
previous-no-pagination | 12 | The number of the previous article regardless of pagination. This will return the number of the last article when the current is the first. |
next-no-pagination | 14 | The number of the next article regardless of pagination. This will return the number of the first article (1) when the current is the last. |
is-first-no-pagination is-last-no-pagination | false / false | A true or false value based on whether the current article is the first/last in the list of articles. |
is-even-no-pagination is-uneven-no-pagination | false / true | A true or false value based on whether the current article is an even/uneven article in the list of articles. |
has-next-no-pagination has-previous-no-pagination | true / true | A true or false value based on whether there is a next/previous article (so can be false for first/last articles). |
No-Limit Numbers
The following numbers data tags return the corresponding values before limit
and offset
are applied:
Syntax | Example | Description |
---|---|---|
total-no-limit | 75 | The total number of articles before limit is applied. This also equals to the count-no-limit of the last article. |
count-no-limit | 13 | The number of the current article in the list of articles, not considering limit or offset. |
previous-no-limit | 12 | The number of the previous article. This will return the number of the last article when the current is the first. |
next-no-limit | 14 | The number of the next article. This will return the number of the first article (1) when the current is the last. |
is-first-no-limit is-last-no-limit | false / false | A true or false value based on whether the current article is the first/last in the total list of articles. |
is-even-no-limit is-uneven-no-limit | false / true | A true or false value based on whether the current article is an even/uneven article in the total list of articles. |
has-next-no-limit has-previous-no-limit | true / true | A true or false value based on whether there is a next/previous article (so can be false for first/last articles). |
See the Numbers section for a full explanation and more details.
Dynamic Data PRO
You can output at any point, dynamic values and data from a specific article, by using one of the prefixes listed below.
You can follow the article prefixes with any of the Data Types, including article data, category data, user data, and custom field values. See the Data from Specific Article section for a full explanation and more details.
Syntax | Description |
---|---|
this:... | Any data type from the article that is currently displayed, so the article that contains the plugin tag itself. |
next:... | Any data type from the next article in the list of articles returned by the plugin tag. |
previous:... | Any data type from the previous article in the list of articles returned by the plugin tag. |
first:... | Any data type from the first article in the list of articles returned by the plugin tag. |
last:... | Any data type from the last article in the list of articles returned by the plugin tag. |
1:... 2:... 3:... etc. | Any data type from a specific article in the list of articles returned by the plugin tag. The data name must be prepended with the respective count number of the article. |
user:... | Any user data of the currently logged-in user (visitor of the page). See the User Data section for a full explanation and more details. |
input:... | Any input data from a URL parameter (query string) or form input. See the Input Values section for a full explanation and more details. |
date('today') date('yesterday') date('tomorrow') etc. | Output a date relative to today, based on your custom date format. See the Relative Dates section for a full explanation and more details. |