Articles Anywhere

Place articles anywhere in Joomla!

  • Last updated: 11 Jun 2019
  • Version: 9.3.3
  • Types: System plugin Editor button plugin
  • Joomla rating: 100%

Tutorial for Articles Anywhere

There is a Free and a Pro version of Articles Anywhere.
The parts in this tutorial that only concern the Pro version will be marked with: Pro only

Introduction

Articles Anywhere is a powerful Joomla system plugin (that also comes with editor button plugin).

With Articles Anywhere you can insert articles anywhere on your site, including within modules, 3rd party components, and even inside other articles.

Not only you can place complete articles, but also only place specific data (like Title, Readmore Link, Text, Images, Custom Fields, etc). You have full control over how you want to display that data and how to style it.

This can change the way you use your articles completely. For instance:

  • Create custom modules displaying the article or articles you want.
  • Create pages that show a number of defined articles
  • Create your own custom blog layout pages/views
  • Create lists of article links (and other data)
  • Use an article as a content snippet, which you can include in multiple other articles/pages

How to use it (syntax)

This is how it works:
You place a starting {article} tag and an ending {/article} tag in your content (other article, module, etc).
This is what we will refer to as the Plugin Tags.

Between these Plugin Tags you can place Data Tags to tell Articles Anywhere what data you want to output.

{article Fluffy Kittens}
[title]
[introtext]
{/article}

The PRO version also allows you to place multiple articles based on Filters, like Category, Tags, Dates, Custom Fields, etc.
You do this by using the {articles} Plugin Tag (so with a trailing s ).

{articles category="Animals"}
[link][title][/link]
[introtext]
{/articles}

Articles Anywhere offers some more cool features, like If Structures.
This makes Articles Anywhere a truly powerful and flexible tool you can use to create all sorts of article-based output.

In this tutorial we will go through these different parts and how to use them.
So we'll dig into the Plugin Tags, the Filters you can use, all the Data Tags will be explained, and you'll also learn how you can use the If Structures.
We will also see many examples of what can be done. You can also find some cool examples here.

Note: You can simply place the tags into the normal WYSIWYG view of your editor. You do not have to switch to the HTML/code view.

Single Article

You start of by defining what article you want to place data from. You can do this by using the title, alias or id of the article:

{article Fox Terrier}...{/article}
{article fox-terrier}...{/article}
{article 123}...{/article}

You can also make the tag use the current active article. This can be useful when you want to place data from the current article inside the article itself (like the title or readmore link) or inside a module.
To do this, simply don't give the article tag a specific article:

{article}...{/article}

Multiple Articles Pro only

The PRO version also supports an {articles} tag to output the data of multiple articles.
Articles Anywhere will repeat the content / data inside the tags for every article that matches the given Filters.

There are different ways you can tell the {articles} tag what articles to output: via a comma separated list of articles, via categories, via tags, via field values and via custom field values.
We will discuss those in depth further on in the tutorial.

To tell the {articles} tag what articles to output and what possible other settings to take into account, we need to use the attribute="value" syntax (similarly to html).

{articles category="Cats" tags="Hairy"}...{/articles}

These attributes can be Filters. But they can also be output settings or filter settings that override the default behavior.

Controlling the Output Pro only

Separating the Output Pro only

The output of the multiple {articles} tag will be whatever output is generated for every article depending on your Data Tags.
This includes any markup you place between the {articles} tags like new lines.

Let’s say you want to list all titles of all the articles in the category "Dogs". And you do this:

{articles category="Dogs"}[title]{/articles}

This would result in something like:

AffenpinscherAfghan HoundAiredale Terrier...Yorkshire Terrier

As you can see all titles are output as one long line without any spaces or lines to separate them.
This behavior might be desired when surrounding the Data Tags with a customized Div layout, but in this example, we will most likely want to separate the articles.

To output every title on a new line, you can simply place the closing {/articles} tag on a new line:

{articles category="Dogs"}[title]
{/articles}

This will result in:

Affenpinscher
Afghan Hound
Airedale Terrier
...
Yorkshire Terrier

But what if you want a comma separated list? To do that, you can use the separator="..." attribute. This will place whatever you put inside the separator attribute between every article. For example:

{articles category="Dogs" separator=", "}[title]{/articles}

Will result in:

Affenpinscher, Afghan Hound, Airedale Terrier, ..., Yorkshire Terrier

Ordering Pro only

In the Articles Anywhere system plugin settings you can define the default ordering of the articles returned by the plugin tag.

You can override the ordering in the {articles} tag by adding an ordering="..." attribute. You can order by any article data, category data, and even by custom field values:

  • title the title of the article
  • alias the alias of the article
  • id the ID of the article
  • ordering the order in the "Articles" manager
  • hits the number of views that the article received
  • created, publish_up, publish_down, modified the creation, published and modified dates.
  • author-id, author-name, author-username the id, name and username of the article author (Created by)
  • modifier-id, modifier-name, modifier-username the id, name and username of the article modifier (Modified by)
  • category or category-title the title of the category attached to the article
  • category-alias the alias of the category attached to the article
  • category-id or catid the id of the category attached to the article
  • category-ordering the order in the "Category" manager
  • featured-ordering the order in the "Featured Articles" manager
  • field-name any other available Article Data (must match the column name in the database table), for example: metakey
  • my-custom-field the value of any Custom Field attached to the article. Use the name of the desired field, for example: nr-of-legs
  • random random order

You can then specify the ordering direction with either ASC for ascending, or DESC for descending.

For example, to output all articles from category "Animals" ordered by title (alphabetically) in descending order:

{articles category="Animals" ordering="title DESC"}...{/articles}

To place all articles in categories "Cats" and "Dogs" in random order:

{articles category="Cats,Dogs" ordering="random"}...{/articles}
Multiple Orderings

You can even specify subsequent orderings to be used, in order of precedence, when the value of the first ordering is the same. You do so by simply separating the multiple orderings via comma:

{articles category="Animals" ordering="publish_up DESC, title ASC"}...{/articles}

There is no limit to how many levels of ordering you can use. If the values of all specified orderings are the same for certain articles, the output will fall back to the default ordering set in the plugin settings.

Limit/Range Pro only

By default Articles Anywhere will show *all* articles matching the given Filters.

In the Articles Anywhere system plugin settings you can define a default limit of maximum articles to be returned.

You can individually define the limit for each {articles} tag with a limit="..." attribute.

To place only the first 20 articles from the category "Animals":

{articles category="Animals" limit="20"}...{/articles}
Offset

You can also show a range of articles not starting from the start. For instance, to show articles 11 to 30, you can do:

{articles tags="Cute but Dangerous" limit="11-30"}...{/articles}

Alternatively, you can use an offset="..." attribute to simply excluide the first X amount of articles from the results.

The following example achieves the same result as before, showing articles 11 to 30 (20 articles starting from the 11th):

{articles tags="Cute but Dangerous" offset="10" limit="20"}...{/articles}
One per Category

You also have the ability to limit the results to only return one article per category, by using a one_per_category="true" attribute.

This can prove useful when showing articles from multiple categories (or when including child categories), and only wanting to show one article from each:

{articles category="Animals" include_child_categories="true" one_per_category="true" ordering="publish_up DESC"}...{/articles}

Pagination Pro only

Articles Anywhere also supports Pagination, offering the ability to split the returned articles in separate pages (similarly to what can be done with the Joomla! Category blog pages).

Pagination by Default

In the Articles Anywhere system plugin settings you can decide if you want to enable pagination by default. And you can define the default number of articles per page to be returned.

If you enabled pagination by default in the settings, but you don't want it in a specific instance of the {articles} tag, you can individually disable it with:

{articles category="Animals" pagination="false"}...{/articles}
Pagination in individual tag

Alternatively, if you do not have pagination enabled by default in the settings, you can enable it in a specific instance of the {articles} tag.

You can either make pagination use of the default number of articles per page from the settings, simply with:

{articles category="Animals" pagination="true"}...{/articles}

Or, for more control, you can individually define the number of articles per page in each {articles} tag with a per_page="..." attribute.

To return all articles from the category "Animals" and display 10 articles per page:

{articles category="Animals" per_page="10"}...{/articles}

You can also combine this with the limit="..." attribute, to set a global limit of returned articles and then define the how many per page:

{articles category="Animals" limit="40" per_page="10"}...{/articles}
Other Settings

When using pagination, Articles Anywhere will add a parameter to the URL to generate pagination links and navigate between pages. By default, this is set to ?page= (followed by the number of the page). The Page URL Parameter can be customized in the plugin settings.

In the plugin settings you can also set the position of the page navigation bar (between top, bottom, or both), and whether to show the pagination results information (such as "Page 1 of 4").

Multiple uses in one webpage

It's important to note that if on the same webpage you use multiple instances of the {articles} tag with pagination, changing page in a set of articles would also change page in the other sets of articles. This happens because, by default, the Page URL Parameter is shared among all {articles} tag uses.

To make sure that changing page in a set of articles doesn't affect the other instances, you can give each {articles} tag its own unique Page URL Parameter by overriding it in the tag with a page_param="..." attribute:

{articles category="Animals" limit="40" per_page="10" page_param="mypage"}...{/articles}

Note: If you're using Joomla cache, you will need to register these additional URL Parameters as "safe", in order to make Joomla create a unique cache for each page. Articles Anywhere allows you to do this in the "Advanced" tab of the plugin settings.
For each extra parameter name, you should also specify what type of value it can be. For pagination params the input type should be set to UINT (which only allow positive numbers as the value).

Output when empty Pro only

Let's say you created a tag to output all articles from category "Fish" that have the tag "Has legs". But the times there are no featured articles in that category, you want to place a little message saying "Currently no fish found with legs!".

You can place this text in the empty attribute.

{articles category="Fish" tags="Has 3 legs" empty="Currently no fish found with legs!"}...{/articles}

Fix HTML Pro only

By default, Articles Anywhere will try to fix any html structure issues it finds.

In the Articles Anywhere system plugin settings you can control the setting. This is on by default as it’s often necessary to deal with surrounding html tags. Only switch this off if you have issues with this.

You can individually override this setting in the {articles} tag by adding a fixhtml="..." attribute with either a true (on) or false (off) value.

{articles category="Penguins" fixhtml="false"}...{/articles}

Filters Pro only

As explained above, you can use Filters to determine what articles should be returned by the {articles} Plugin Tag. The filters will determine what list of articles is output, along with the Limit and Ordering.

So for instance, you can show data from the articles in a certain category that also have a specific tag:

{articles category="Dogs" tags="Tiny"}...{/articles}

You can combine any filters to narrow down the resulting list of articles. Each filter can also have multiple values, separated with a comma.
Note that values in filters should only be separated by a comma, so no extra spaces between the values.

{articles category="Cats,Dogs" tags="Tiny,Small,Medium"}...{/articles}

Note: if you don't specify any filter, *all* articles from the website will be returned.

Let’s take a look at all the Filter Types available:

Filter Types Pro only

Articles

You can simply specify a comma separated list of articles you want to display.

You can insert the titles, aliases or IDs of the desired articles, inside an articles="..." attribute.

{articles articles="Main Coone,norwegian-forest-cat,123"}...{/articles}

Or instead of articles="...", you may also use items, id, ids, title or alias as an attribute. These are all aliases of the same funcionallity, so you can use whichever suits your preference. So these will also work the same as the above example:

{articles items="Main Coone,norwegian-forest-cat,123"}...{/articles}
{articles ids="Main Coone,norwegian-forest-cat,123"}...{/articles}

If your article title contains a comma, either simply use the article alias or ID instead, or escape the comma. For instance, if you want to show the articles "American, British and Exotic Shorthair" and "Munchkin", you can escape the comma with \ in front of the article:

{articles articles="American\, British and Exotic Shorthair,Munchkin"}...{/articles}
Categories

You can display multiple articles by their category. All you need to do is to place a category="..." attribute in the tag.

You can use the titles, aliases or IDs of the desired categories, separating multiple categories with a comma.

{articles category="Some Category,another-cat,12"}...{/articles}

To also include the articles from all child categories (subcategories of the given category), you can add the include_child_categories="true" attribute.

To include the articles from the first level of child categories (categories directly under the given category), you can add the include_child_categories="1" attribute. And use include_child_categories="2" to include the articles from the first and second level of child categories.

Tags

You can display multiple articles by their tags. All you need to do is place a tags="..." attribute in the tag.

{articles tags="Fluffy,Cuddly"}...{/articles}
Authors

Want to only show articles by a certain author? Just filter down based on the created_by ID.

{articles created_by="42"}...{/articles}

You can even show articles written by the user currently browsing the website, by utilizing the user:id value.

{articles created_by="user:id"}...{/articles}

You can also filter by the modified_by value to output articles last modified by a certain author.

Dates

You can filter articles based on the publish_up, created and modified dates, as well as custom fields of type calendar. You have various formats that you can use inside any of these date filters.

To return articles published at an exact Date and Time:

{articles publish_up="2019-02-15 09:30:00"}...{/articles}

To show all articles published on a specific Date (regardless of time):

{articles publish_up="2019-02-15"}...{/articles}

To filter articles by Month (for example, showing all articles published in February 2019):

{articles publish_up="2019-02"}...{/articles}

And to show all articles published in a certain Year, you can simply do:

{articles publish_up="2019"}...{/articles}

You can also show articles published before or after a certain Date (Time, Month and Year formats are also possible). To do this, use the "Greater or Less than..." feature as described in the Comparison Operators section:

{articles publish_up=">2019-02-15"}...{/articles}
{articles publish_up="<2019"}...{/articles}

The date filter even supports Date Ranges. This allows you to show articles published between two specific dates (Time format is also possible):

{articles publish_up="2018-11-14 to 2018-11-28"}...{/articles}
{articles publish_up="2019-02-15 09:30:00 to 2019-02-15 18:30:00"}...{/articles}

And you can use special Relative Dates values to return and compare articles from the current day, yesterday, tomorrow, or any other date relative to today.

This, for example, allows to output all articles published yesterday. Or to output all articles published in the last 30 days:

{articles publish_up="date('yesterday')"}...{/articles}
{articles publish_up="date('-30 days') to NOW"}...{/articles}

Note: All Date Filters will be adjusted correctly according to the Time Zone used on your website.

Featured

You can make Articles Anywhere output all featured articles by adding a featured attribute:

{articles featured="true"}...{/articles}

Or exclude all featured articles:

{articles featured="false"}...{/articles}
Custom Fields

You can even filter articles by the value of the custom fields. You need to use the field name as the attribute key.

Let's say you have a custom field "Number of legs" that has a field name nr-of-legs and you want to filter down to articles that have this value set to 3.

{articles nr-of-legs="3"}...{/articles}

You can also filter to articles where a custom field value is greater or less than your specified value (See the Comparison Operators section for a full explanation):

{articles nr-of-legs=">3"}...{/articles}
{articles nr-of-legs="<3"}...{/articles}
Article Data

Like with the custom fields, you can also filter down to any other article data. As long as it is directly saved in the articles database (must match the column name in the database table).

So you can use filters like metakey="..." to show articles that have the metakey field containing a certain value.

Comparison Operators Pro only

Articles Anywhere also allows you to use different comparison operators to filter your articles by.
Negative Values

To apply a negative filter that excludes certain articles, you can add ! before the value.
So this will show all articles in the category "Cats" that do not have the tag "Cuddly":

{articles category="Cats" tags="!Cuddly"}...{/articles}

You can also apply a negative filter with multiple values, separating them with a comma:

{articles category="!Some Category,!another-cat,12"}...{/articles}
Greater or Less than…

You can apply comparison filters on numeric and date values, by prepending the value with <, <=, > or >=.

For example, if you want to show all articles that have the nr-of-legs custom field value equal or greater than 2:

{articles nr-of-legs=">=2"}...{/articles}

Or to show all articles that have a publish_up date equal or greater than February 15, 2019:

{articles publish_up=">=2019-02-15"}...{/articles}

You can also compare dates to the current date using Relative Dates or the NOW value.

Wildcards Pro only

You can use the * wildcard to match articles, categories, tags, custom fields or other filters by only a part of the value.

The following syntax will return all articles that have a title/alias starting with "grey":

{articles articles="grey*"}...{/articles}

The following syntax will return all articles that have a title/alias containing "cat":

{articles articles="*cat*"}...{/articles}

The following syntax will return all articles in categories that have a category name ending in "hound":

{articles category="*hound"}...{/articles}

Empty Values Pro only

Output Articles with Empty Values

You can also filter down to articles where a certain field value doesn't exist (meaning it's empty or null).

To do so, simply leave the filter value (between quotes) empty.

The following syntax will return all articles that don't have any tag attached:

{articles tags=""}...{/articles}

The following syntax will return all articles that don't have a value set for the custom field nr-of-legs:

{articles nr-of-legs=""}...{/articles}
Exclude Articles with Empty Values

Viceversa, you can filter down to articles where a certain field value DOES exist (meaning it's NOT empty or null), no matter what the value is.

To tell the filter to show the articles where a value is not empty, use + as the value.

For instance, the following syntax will return all articles that have at least one tag attached:

{articles tags="+"}...{/articles}  

Alternatively, you can also use the wildcard to match any value, as long as the data exists:

{articles nr-of-legs="*"}...{/articles}  

Dynamic Values Pro only

As we seen so far, you can filter articles by specific values. However, you can also use dynamic values!

Same Values as Current Article

If you want to get all articles that have the same value of a certain data as the current article being displayed, you can use the current value.

For instance, to get the articles that are under the same category as the current article, you can simply use: category="current". Or to get the articles written by the same author, use created_by="current". Even Custom Fields values are supported.

Vice versa, to exclude the current article from the results, you can add articles="!current" to the plugin tag.

Data from Current Article

Data from the article that contains the Plugin Tag or is being currently displayed, is also available to be used inside any Filter.

This can prove useful especially in combination with Articles Field, to return the list of articles that are pointing to the Current Article via Articles Field, by utilizing this:id:

{articles my-custom-field="this:id"}...{/articles}

You can also use other article data or custom fields:

{articles my-custom-field="this:alias"}...{/articles}

The [this:...] values available are explained more in detail in the Data Tags section.

Data from Current User

Data from the user that is logged in the website is available to be used inside any Filter, for example by utilizing the user:id value.

This is particularly useful to return a dynamic list of articles that changes based on the user that is currently browsing the website and viewing that page:

{articles created_by="user:id"}...{/articles}

You can also use other values such as user:username:

{articles my-custom-field="user:username"}...{/articles}

The [user:...] values available are explained more in detail in the Data Tags section

Relative Dates

You can use Relative Dates and Custom Formats inside Filters and If Structures.

This allows to return articles that have a dynamic date value of the current day, yesterday, tomorrow, or any other date relative to today. All Relative Dates can also be combined and used with Comparison Operators or Date Ranges.

For example, to return a dynamic list of articles that have a date of yesterday:

{articles event-date="date('yesterday')"}...{/articles}

To show all articles that have a date in the future:

{articles event-date=">date('today')"}...{/articles}

Or using a Date Range to output the articles published in the last 30 days:

{articles publish_up="date('-30 days') to NOW"}...{/articles}

Below you find some more examples of the type of values you can use:

  • NOW or date() or date('now') => return current date and time (2019-06-18 06:49:06)
  • date('today') => return current date (2019-06-18)
  • date('tomorrow') => return date of tomorrow (2019-06-19)
  • date('yesterday') => return date of yesterday (2019-06-17)
  • date('-1 day') => return date of yesterday with current time (2019-06-17 06:49:06)
  • date('+2 days') => return date of 2 days from now with current time (2019-06-20 06:49:06)
  • date('-1 week') => return date from 1 week ago with current time (2019-06-11 06:49:06)
  • date('-1 month') => return date from 1 month ago with current time (2019-05-18 06:49:06)
  • date('-1 year') => return date from 1 year ago with current time (2018-06-18 06:49:06)

See the full list of the possible Relative Date Values that can be used.

For any relative date value, you can also customize the date format it should use. Here are some examples:

  • date('today', 'l') => return today's week day name (Tuesday)
  • date('today', 'F') => return current month's name (June)
  • date('today', 'Y') => return current year (2019)
  • date('tomorrow', 'Y-m-d H:i:s') => return date of tomorrow with time 00:00:00 (2019-06-19 00:00:00)
  • date('yesterday', 'Y-m-d H:i:s') => return date of yesterday with time 00:00:00 (2019-06-17 00:00:00)
  • date('-1 day', 'Y-m-d') => return date of yesterday (2019-06-17)
  • date('+2 days', 'Y-m-d') => return date of 2 days from now (2019-06-20)
  • date('-1 week', 'Y-m-d') => return date from 1 week ago (2019-06-11)
  • date('-1 month', 'Y-m') => return last month in Y-m format (2019-05)
  • date('-1 year', 'Y') => return last year (2018)

The date format characters that you can use are based on the PHP date function.

Note: All Date Filters will be adjusted correctly according to the Time Zone used on your website.

Input Values

Articles Anywhere can also dynamically access data from URLs and form inputs, thanks to a special "input:.." value.

This allows you to change which articles are displayed on your page based on the data sent by a form (both GET and POST form requests are supported), or based on a custom parameter added to the URL (which can be anything you want). For example:

{articles category="input:cat"}...{/articles}

With this plugin code, you could then customize the category from which the articles are returned, by simply passing a parameter in the URL like:

https://www.mysite.com/my-articles?cat=27

You are also able to set a default value to be used in case the specified parameter is not passed, by adding after the parameter name separated by a colon. For instance, to show articles from the category "Animals" by default, unless overruled via your ?cat=... parameter:

{articles category="input:cat:Animals"}...{/articles}

You can also use this in If Structures, to conditionally output content based on the input value. For example, to show a "HOT!" label for all articles with more than 100 hits, you could add a custom ?min-hits=100 parameter, and then do:

{articles category="My Category"}
[title] {if hits>input:min-hits}HOT!{/if}
{/articles}

Or, for example, you can use this to provide access to registered articles via a URL key (such as ?pass=ABC123):

{articles category="My Special Articles" ignore_state="true"}[title]
{if input:pass="ABC123"}
   [text]
{else}
   This content is password restricted!
{/if}
{/articles}

Note: If you're using Joomla cache, you will need to register these additional URL Parameters as "safe", in order to make Joomla create a unique cache for each page. Articles Anywhere allows you to do this in the "Advanced" tab of the plugin settings.
For each extra parameter name, you should also specify what type of value it can be.

Filter Settings Pro only

Access-Restricted Articles

By default Articles Anywhere will not show articles that are access restricted. This means, articles with an access level not matching the users access level.
But you may want to show the titles or some alternative text to visitors that don't have access to the article.
To achieve this, you must first make sure the restricted articles will be collected and output by Articles Anywhere.
You can either switch on the global Ignore Article Access Level setting in the Articles Anywhere system plugin settings, or override this setting via the {article} or {articles} tag:

{articles category="Lizards" ignore_access="true"}

Then you can use the has_access value in the If Structures to conditionally output alternative content.
This example will show a list of linked titles, but show an unlinked title with extra text for restricted articles:

{articles category="Bears" ignore_access="true"}
{if has_access}[link][title][/link]
{else}[title] (Please log in to read)
{/if}
{/articles}
Unpublished Articles

By default Articles Anywhere will not show articles that are unpublished or archived.
In case you do want to also show these articles, you can change this setting in the Articles Anywhere system plugin settings, or override this setting via the {article} or {articles} tag:

{articles category="Lizards" ignore_state="true"}

To only show archived articles, you can specify the article status with the state attribute: archived state is represented by a 2 value (while "unpublished state" is represented by a 0 value).

{articles state="2" ignore_state="true"}

Similarly to the above example, here you can use If Structures with the is_published value to check whether an article is published and conditionally output alternative content:

{articles category="Bears" ignore_access="true"}
{if is_published}[link][title][/link]
{else}[title] (This article is not published)
{/if}
{/articles}
Articles in Different Languages

By default Articles Anywhere will not show articles that are language restricted. This means, articles with a language not matching the current active language.
In case you do want to show articles of all languages, you can change this setting in the Articles Anywhere system plugin settings, or override this setting via the {article} or {articles} tag:

{articles category="Lizards" ignore_language="true"}

Multiple Groups Pro only

In some cases you don't want filters to narrow the result down, but to extend it.
You can group different filters by separating the groups with AND.
For instance, you might want to show all articles from the "Dogs" category AND all featured articles that have the tag "Tiny".

{articles category="Dogs" AND featured="true" tags="Tiny"}...{/articles}

You can use multiple filters per group.

Note that any Filters or Filter Settings (like include_child_categories) will be applied to each individual group, so they can be different for each group. However, any Output Settings (like ordering, limit and per_page) will be applied to the whole tag.

So, for example (new lines are just for clarity):

{articles
category="Animals" include_child_categories="true"
AND category="Fruit"
AND tags="Monsters"
limit="10" ordering="title"
}
...
{/articles}

This tag will return only 10 articles in total in alphabetical order, from:

  • the articles in the "Animals" category (including all sub-categories)
  • AND the articles in the "Fruit" category (NOT including any sub-categories)
  • AND the articles that have the tag "Monsters".

Data Tags

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 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 article with id 123, you can do:

{article 123}[title]{/article}

Overview

You can place the following Data Tags related to articles, categories, and even dynamic data.

Article Data

  • [article] the entire article. See the Full Article section for a full explanation.
  • [title] the title of the article
  • [alias] the alias of the article
  • [id] the ID of the article
  • [text], [introtext], or [fulltext] showing the full text or the intro text of the article. See the Text section for a full explanation.
  • [created], [publish_up], [publish_down], [modified] the creation, published and modified dates. See the Dates section for a full explanation.
  • [author-id], [author-name], [author-username] the id, name and username of the article author (Created by)
  • [author-alias] or [created-by-alias] the alias set in the "Created by Alias" field of the article
  • [modifier-id], [modifier-name], [modifier-username] the id, name and username of the article modifier (Modified by)
  • [has_access] a true/false value based on whether the visitor has access to the article
  • [is_published] a true/false value based on whether the article is published or not
  • [hits] the number of views that the article received
  • [field-name] any other available Article Data (must match the column name in the database table), for example: [metakey]
  • [tags] the tags attached to the article. See the Tags section for a full explanation. Pro only
  • [my-custom-field] the value (and label) of any Custom Field attached to the article. Use the name of the desired field, for example: [nr-of-legs]. See the Custom Fields section for a full explanation. Pro only

Category Data

  • [category] or [category-title] the title of the category attached to the article
  • [category-alias] the alias of the category attached to the article
  • [category-id] or [catid] the id of the category attached to the article
  • [category-description] the description text of the category attached to the article

Links

  • [link]...[/link] open and close tag to add a link to the article
  • [url] the url to the article (you can also use [sefurl] in special cases)
  • [readmore] a "read more" button that links to the full article. See the Read more section for a full explanation.
  • [edit] a link to the article edit page. See the Edit Link section for a full explanation. Pro only
  • [category-link]...[/category-link] open and close tag to add a link to the category Pro only
  • [category-url] the url to the category (you can also use [category-sefurl] in special cases) Pro only

Images

  • [image-intro] the intro image attached to the article
  • [image-fulltext] the full article image attached to the article
  • [image-...] the image by given number found inside the article text, ie [image-2] to get the 2nd image found Pro only
  • [image-random] to output a random image from the content of the article Pro only
  • [image-category] the image of the category attached to the article Pro only
  • [my-image-field] the image from a custom field of type media Pro only

The Pro version of Articles Anywhere also has the ability to automatically create resized images and much more. See the Images section for a full explanation and more details.

Videos Pro only

  • [youtube-...] the YouTube iframe tag by given number found inside the article text, ie [youtube-1] to get the 1st video found
  • [youtube-...-thumb] the thumbnail for the YouTube video by given number found inside the article text, ie [youtube-2-thumb]
  • [vimeo-...] the Vimeo iframe tag by given number found inside the article text, ie [vimeo-1] to get the 1st video found

See the Videos section for a full explanation and more details.

Numbers Pro only

  • [total] the total number of articles returned in the page
  • [total_no_pagination] the total number of articles before pagination is applied
  • [total_no_limit] the total number of articles before the limit is applied

  • [count] the number of the article in the returned list of articles in the page
  • [count_no_pagination] the number of the article in the returned list of articles regardless of pagination

  • [first] a true/ false value based on whether the article is the first in the returned list of articles in the page
  • [last] a true/ false value based on whether the article is the last in the returned list of articles in the page
  • [even] a true/ false value based on whether the article is an even article in the returned list of articles
  • [uneven] a true/ false value based on whether the article is an uneven article in the returned list of articles
  • [next] the number of the next article in the list. This will return the number of the first article (1) when the current is the last
  • [previous] the number of the previous article in the list. This will return the number of the last article when the current is the first
  • [has_next] / [has_previous] a true/ false value based on whether there is a next/previous article (so can be false for first/last articles)

  • [limit] the maximum number of articles set to be returned
  • [per_page] the number of articles per page set to be returned when using pagination
  • [pages] the the number of pages generated by the results when using pagination
  • [page] the number of the current page when using pagination
  • [has_next_page] / [has_previous_page] a true/ false value based on whether there is a next/previous page (so can be false for first/last pages)

  • [every-...] a true/ false value based on the article number of the article in the returned list of articles
  • [is-...-of-...] a true/ false value based on the article number of the article in the returned list of articles

See the Numbers section for a full explanation and more details.

Data from Current Article Pro only

The [this:...] Data Tags will return any available data of the article that contains the Plugin Tag or is being currently displayed.

  • [this:id]
  • [this:title]
  • [this:alias]
  • [this:catid]
  • [this:...] any other available Article Data or Custom Field (for example: [this:speaker])

These can also be used in If Structures, for example to highlight the current active article in the list of articles returned by Articles Anywhere.

The following example checks whether the ID of one of the returned articles is the same as the current active article, and if it is, shows a different output (without the link):

{articles category="My Category"}
{if id = this:id}[title] (current)
{else}[link][title][/link]
{/if}
{/articles}

Data from Current User Pro only

The [user:...] Data Tags will return any available data of the visitor of the page.
If the visitor is not logged in, most of these Data Tags will return empty.

  • [user:id] the id of the user. This will be 0 if the visitor is not logged in.
  • [user:name]
  • [user:username]
  • [user:email]
  • [user:guest] a false or true value based on whether the visitor is logged in or not.

Input Values Pro only

The data accessed from URLs and form inputs, can also be output via the  [input:...] Data Tags.

For example, when passing a category via URL with a custom parameter:

https://www.mysite.com/my-articles?cat=Animals

You could then return the input category in the output:

{articles category=“input:cat”}{if first}Articles from category: [input:cat]{/if}
• [title]
{/articles}

Styling

You can give the tags any styling you want simply by using the styling options in your editor.

For instance, you can make the title a Heading 3 by selecting the [title] tag and choosing Heading 3 in your editors styles.

So something like this can be done:

Full Article

The [article] tag will render the Full Article the way your template does in the default article page. Generally that includes the title, text and some meta data, like the author and published date (depending on your settings).

So if you want to output the complete article, you can do:

{article Modern Persian Cat}[article]{/article}

But if you place nothing between the opening and ending tags, the full article will be used too. So this also works:

{article Modern Persian Cat}{/article}

Alternative Layout

If you want to use an alternative article layout (to be placed inside templates/my_template/html/com_content/article/) you can simply insert the name of the file in the layout="..." attribute:

[article layout="my-layout-name"]

You can also use the layout from a different template, by also specifying the template where it resides:

[article template="my_template" layout="my-layout-name"]

Read More Link

You can output an Read More Link by using [readmore]

When showing the read more link, you can also override the standard Read more... text.
For example, if you want the text Please read on! to link to the article:

[readmore text="Please read on!"]

Resulting in something like:

Adding or overriding attributes

You can override any attributes or set extra attributes to be used in the final <a> tag in any link data tag that generates one.

For example, the readmore link gets the default readmore class name. If you want to override that, you can do:

[readmore text="Please read on!" class="my-own-class"]

Or if you only want to override the class (and not the text):

[readmore class="my-own-class"]

Text Options

To render the entire text from the article you can use the [text] tag.

You can also decide to only show the [introtext] (the text part above the readmore bar, if present) or the [fulltext] (the text part below the readmore bar, if present).

Limiting and stripping text

With any text data tag - like [text], [introtext], [fulltext], [title], [metakey], [metadesc], and even custom fields of type text, textarea and editor, you can limit the text to only show a certain amount of characters. HTML tags and images are not counted, only the text itself.

Limit by characters

For example, to show the first 100 characters of the entire text, simply use:

[text limit="100"]
Limit by words

To limit the text to a number of words, you can do:

[text words="20"]
Limit by paragraphs

You can limit the text to a number of paragraphs.

This will break off the text after the second </p> tag it finds in the html code:

[text paragraphs="2"]
Stripping html tags

If you want to strip the text from html tags for any reason, you can do:

[text strip="true"]
[text limit="100" strip="true"]
Stripping image tags

You might want to keep the html tags and styling of the content, but remove the images. You can do that with:

[text noimages="true"]

Page breaks

In Joomla you can split a text into multiple pages using page breaks.

You can output these different pages separately via the page attribute.
For instance, to only output the 3rd page of an article, you can do:

[text page="3"]

Or use the given title for that page, like:

[text page="My Third Page"]

Offset Headings

When including the text of multiple articles inside another article, you might want to shift the heading tags of the placed articles to a lower level.

You can offset the level of the headings in text data tags by using an offset_headings attribute. For instance, to convert H1 to H3, H2 to H4 and so on, set the attribute to 2:

[text offset_headings="2"]

Headings will be a minimum of 1 and a maximum of 6. So if you have headings going up to H6, then with offset_headings="1" both H5 and H6 will become H6.

Dates

Any Data Tag that has a date value, such as [created], [publish_up], [modified] , or even custom fields of type calendar, can be output and have the date format specified with this syntax:

[publish_up format="F jS Y"]

That would result in: June 18th 2019

The date format characters that you can use are based on the PHP date function.

You can also use date values inside If Structures, like:

{if created >= '2019-02-15'}...{/if}

And you can even compare dates to the current date using Relative Dates or the NOW value.

{if publish_up > NOW}Coming soon{/if}

Images

You can place different images using the dedicated image data tags. This includes Intro & Full Article images, images from content, category images and even custom fields of type media.

Image Types

Intro & Full Article Images

You can output the article Intro Image with [image-intro], or the Full Article Image with [image-fulltext].

To output the url of these images instead - for instance to create your own custom <img> tag - simply add -url to the tag: [image-intro-url] or [image-fulltext-url].

If you want to output the images through the respective Joomla content layouts you can do: [image-intro layout="true"] or [image-fulltext layout="true"].

And you are also able to override the layout with a custom one by inserting the path to your file in the layout="..." attribute. The custom layout path starts from the layouts folder of your template, and the various subdirectories must be separated with dots. For example, to use file templates/my_template/html/layouts/joomla/content/my_image_layout.php, the syntax would be:

[image-intro layout="joomla.content.my_image_layout"]

You can also output the other attributes regarding the intro image and full article image, such as: [image-intro-alt], [image-intro-caption], [image-fulltext-alt], [image-fulltext-caption].

Images from content Pro only

The Pro version gives you the ability to place images that have been placed inside the content of the article's text.

To place the first image, simply use [image-1]. To place the fifth image found in the content, use [image-5]. You can even use [image-random] to output a random image from the content of the article.

To output the url of these images instead - for instance to create your own custom <img> tag - add -url to the tag. So [image-1-url] for the url of the first image and [image-5-url] for the url of the fifth image.

You can grab any available attribute that is found inside the original html <img> tag too. For instance, [image-3-width] will output whatever is found in the width="..." attribute. If the attribute is not found in the <img> tag, it will simply return nothing.

And you can use the [image-count] data tag to output the total number of images found in the text, which is also available to be used in If Structures.

When placing images from content, you are also able to filter images by adding a filter attribute. This will then only return the image matching your filter. Let's say the first image in the article is cats.jpg, the second guinea-pigs.jpg and the third is pigs.jpg. Using [image-2 filter="pigs"] will show you pigs.jpg, as that is the second image matching the filter.

The Filter attribute supports Regular Expressions. For example, to only show the first image from the article that contains either "dog", "hound" or "pug", you can use: [image-1 filter="(dog|hound|pug)"].

YouTube Thumbnail Pro only

The Pro version gives you the ability to get the youtube thumbnail image from YouTube videos that have been placed inside the content of the article's text (via the youtube iframe code).

You can output the thumbnail image itself with [youtube-...-thumb], or just the url with [youtube-...-thumb-url].

Category Image Pro only

The Pro version allows you to output the image attached to the category of the article.

You can output the image itself with [image-category], or just the url with [image-category-url].

Media Custom Fields Pro only

The Pro version also allows you to output the image from a custom field of type media attached to the article.

You can do so by simply using the name of the custom field, such as: [my-image-field].

To instead output the url of the image, as saved in the database, you can do: [my-image-field output="value"].

Adding or overriding attributes

In any [image-...] tag, you can override any attribute or set extra attributes to be used in the final <img> tag.

For instance, you can set the width and height attributes, or override the class name:

[image-3 class="my-new-class-name"]
[image-intro width="200" height="150"]

When you set width and height attributes, Articles Anywhere Pro will take advantage of the image resizing feature.

Auto Alt/Title Attributes Pro only

The Pro version comes with the ability to automatically set the Alt and Title Attributes for any [image-...] tag placed through Articles Anywhere, with options to base them on the image File Name, the Article Title and more.

The preference can be set individually for each image type in the Articles Anywhere Plugin Settings. This only applies when the image doesn't already have its own attributes specified.

When basing the attributes on the image file name, you can also select how they should be cased. You can set them to be lowercase, UPPERCASE, Uppercase only the first letter, Uppercase All Words, or Smart Titlecase (which allows you to input a list of words that should remain lowercase).

For example, this allows the Alt/Title attributes for an image called soft-and-fluffy.jpg to be automatically set to “Soft and Fluffy”.

Image Resizing Pro only

The Pro version of Articles Anywhere has the ability to automatically create resized images with your specified width/height, instead of outputting the original image files.

Settings

You can control the default behavior of the "Resize Images" feature via the Articles Anywhere system plugin settings, with three alternative options:

  • No - Don't resize images
    Images will NOT be resized when setting width/height attributes in [image-...] data tags.
    The original image file will always be used, and will only be shrinked to the specified dimensions..

  • Standard (default setting) - Only resize when dimensions are given
    Images will be resized and output based on the width/height attributes in [image-...] data tags.
    If no width or height attributes are found in the data tag, the original image will be used.

  • Yes - Always resize images
    Images will be always resized.
    If no specific width or height attributes are found in the data tag, the image will be resized based on the dimensions in the default settings.

In any case, you can also individually override/force this setting in a specific [image-...] data tag by adding a resize="..." attribute with either a true (Yes) or false (No) value:

[image-fulltext resize="true"]

In the Default Settings you can also set the quality of the resized images, select the filetypes to do resizing on (gif, jpg, png), and decide whether you want the images to be cropped or not.

Resized image files are stored inside a subfolder of the location containing your original image. By default, the folder name is resized, but you can customize it however you want.

Note: Only internal images hosted on your website will be resized. External images will not be resized or saved, and the original external images will be used regardless of the settings.

Data Tags Syntax

When resizing images via the [image-...] data tag, you don't need to specify both width and height attributes. You can also just specify one, and the image will be resized maintaining its aspect ratio.

[image-fulltext width="240"]

Resulting in:

<img src="/images/gallery/resized/apples_240x180.jpg" title="Apples" alt="Apples" width="240" height="180" />

Apples

When you specify both width and height attributes, resized images will be created with the exact width and height, meaning that if proportions are different, the image will be cropped to fill the specified dimensions.

[image-fulltext width="240" height="240"]

Resulting in:

<img src="/images/gallery/resized/apples_240x240.jpg" title="Apples" alt="Apples" width="240" height="240" />

Apples

Using the [image-random] tag described in "Images from content", you can make cool stuff like this:

[image-random width="130" height="40"][image-random width="30" height="40"][image-random width="80" height="40"]
[image-random width="200" height="80"][image-random width="40" height="80"]
[image-random width="60" height="60"][image-random width="40" height="60"][image-random width="140" height="60"]
BananasBlueberriesApples
BananasOranges
BlueberriesApplesBananas

(Refresh the page to see the above images change on every pageload)

Custom Images / Suffixes

You can also output images with a suffix of your choice added to their filenames. You will need to create these images yourself, and name them using the given suffix.

Let's say you have this <img> tag in your content: <img src="/images/my_image.jpg" />.

Then you can do [image-1 suffix="_custom"] to output: <img src="/images/my_image_custom.jpg" />.

This could be useful to be used in If Structures to conditionally output alternative custom images in certain situations. This example will show a different image to guest users:

{if user:guest}[image-1 suffix="_guest"]
{else}[image-1]
{/if}
Visible to guests:
Apples
Visible to logged in users:
Apples

Videos Pro only

YouTube Videos

The Pro version gives you the ability to get data from YouTube videos that have been placed inside the content of the article's text (via the youtube iframe code), similarly to the "Images from content" feature.

  • [youtube-1]to place the first YouTube video found. To place the fifth video found in the content, use [youtube-5].
  • [youtube-...-url] to output the url of these videos instead. This will output the url as you see it in the browser.
  • [youtube-...-iframe-url] to output the embed url for use in iframes.
  • [youtube-...-short-url] to output the short url (using the youtu.be domain)
  • [youtube-...-id] to output only the id of the video
  • [youtube-...-link]...[/youtube-...-link] to add a link to the YouTube video
  • [youtube-count] to output the total number of YouTube videos found in the text. You can also use this value in the If Structures.

You can grab any available attribute that is found inside the original html <iframe> tag too. For instance, [youtube-3-class] will output whatever is found in the class="..." attribute. If the attribute is not found in the <iframe> tag, it will simply return nothing.

You can also output the youtube thumbnail image for the video using [youtube-...-thumb]. And like with other Image tags, you can output the url with [youtube-...-thumb-url].

This example below will output a linked thumbnail image of the first youtube video found in the article:

[youtube-1-link][youtube-1-thumb][/youtube-1-link]

Vimeo Videos

Vimeo is also supported. The Pro version gives you the ability to get data from Vimeo videos that have been placed inside the content of the article's text (via the vimeo iframe code).

  • [vimeo-1] to place the first youtube video found. To place the fifth video found in the content, use [vimeo-5].
  • [vimeo-...-url] to output the url of these videos instead. This will output the url as you see it in the browser.
  • [vimeo-...-iframe-url]to output the embed url for use in iframes.
  • [vimeo-...-id]to output only the id of the video.
  • [vimeo-...-link]...[/vimeo-...-link] to add a link to the vimeo video
  • [vimeo-count]to output the total number of Vimeo videos found in the text. You can also use this value in the If Structures.

You can grab any available attribute that is found inside the original html <iframe> tag too. For instance, [vimeo-3-class]will output whatever is found in the class="..." attribute. If the attribute is not found in the <iframe> tag, it will simply return nothing.

Adding or overriding attributes

You can also override attributes or set extra attributes to be used in the output <iframe> tag in any video data tag that generates one.

For instance, you can set your own class name:

[youtube-3 class="my-youtube-vid"]
[vimeo-2 class="my-vimeo-vid"]

Tags Pro only

You can display the tags of an article with the [tags] tag.

This shows the tags of article "Catfish":

{article Catfish}[tags]{/article}

By default, the output will be generated through the Joomla layout for tags. If you want it to output unstyled simple links, you can add the clean="true" attribute.

You can also set a specific separator to place between the tag links:

[tags clean="true" separator=" - "]

To output the tags as plain text - so not as links - use the strip="true" attribute.

Custom Fields Pro only

You can display any custom field of an article using the name of that specific field.

Let's say you want to show the value of the custom field "Habitat" - that has a field name habitat_area - of article "Lions". You can simply do:

{article Lions}[habitat_area]{/article}

Field Label

By default only the value of the field is shown. To also output the label along with the value of the field, like "Habitat: Africa":

[habitat_area label="true"]

While to individually output only the label of the field:

[habitat_area label="only"]

Using Layouts

If you assigned a Layout to your custom field (option introduced in Joomla 3.9), Articles Anywhere will account for it and display the value using that layout.

Otherwise, by default the custom field will be output as plain text without any html markup around it.

If you want to output the custom field through its whole layout, like the core plugin does, you can do:

[habitat_area layout="true"]

The layout will then output both the value and the label (if enabled). To not show the label, you can do:

[habitat_area layout="true" label="false"]

Layout Overrides

By default - when using layout="true" - Articles Anywhere will use the layout assigned to that custom field in its Render Options.

However, in the data tag you are able to override the set layout with another one (to be placed inside templates/my_template/html/layouts/com_fields/field/), by simply inserting the name of the file in the layout="..." attribute:

[habitat_area layout="habitat-field"]

Alternatively, you can also insert the full path to your custom layout file:

[habitat_area layout="templates/my_template/html/layouts/com_fields/field/habitat-field.php"]

If you are not familiar with layout overrides, check out the dedicated guide and examples on how to create a Custom Field Layout Override.

On the other hand, If your custom field already has an alternate layout assigned in the core option, but you want to display it with the default layout (components/com_fields/layouts/field/render.php), you can do:

[habitat_area layout="default"]

Raw values (Option values)

For certain custom field types, the custom field value gets stored differently in the database compared to how it's displayed on the site.

For example, in field types that can have multiple values (like lists, checkboxes and radio buttons), for each option you can enter the name and its option value. By default, the custom field data tags will output the names of the values.

For instance, the "Habitat" field is a custom list field that has option names Africa, Asia and Europe with respectively option values af, as and eu. Let's say the second option is selected for the current article. Then [habitat_area] will output: Asia.

If you want to instead output the raw value as saved in the database, you can use the output="value" attribute. This will make it output the option values instead of the names.

[habitat_area] => Asia
[habitat_area output="value"] => as

Here is an example of how you could use both the name and value of the custom field - using the raw value as a class name:

<div class="habitat-[habitat_area output="value"]">[habitat_area]</div>

When saving this, your editor might mess up the code because of the nested quotes. You can work around this issue by using the quote html entity &quot; inside the data tag instead:

<div class="habitat-[habitat_area output=&quot;value&quot;]">[habitat_area]</div>

This will result in:

<div class="habitat-as">Asia</div>

Separator for multiple values

When using custom field types that can have multiple values (like lists, checkboxes and articles), the values will be normally output separated by a comma, like:

Africa, Asia, Europe

But you have the ability to change the separator to something else, by using a separator="..." attribute inside the data tag. For instance:

[habitat_area separator=" - "]

Which will result in:

Africa - Asia - Europe

Value Layouts

In addition to the Field Layout, Articles Anywhere also allows you to customize the output specifically related to the "value" part of a custom field.

This can come especially useful if you need further control on custom field types that have multiple values (like lists, checkboxes and multi-select fields).

Check out the dedicated guide and example on how to create a Value Layout.

Once created, you can pass the name of your custom file to the data tag with a value_layout="..." attribute:

[habitat_area value_layout="bullet-list-values"]

Or use the full path to the layout file:

[habitat_area value_layout="templates/my_template/html/layouts/com_fields/field/bullet-list-values.php"]

Edit Link Pro only

You can output an Edit Link Button to users that have the correct permissions by using [edit]

When showing the edit link, you can also override the standard Edit text, like this:

[edit text="My Custom Edit Button"]

Resulting in something like:

You can also decide to only output the edit URL - for instance, to make your own custom link - by using: [edit-url]

You can also make a custom edit link by using:

[edit-link]My Custom Edit Link Text[/edit-link]

Adding or overriding attributes

You can override any attributes or set extra attributes to be used in the final <a> tag in any link data tag that generates one.

For instance, the edit link gets a btn as default class name, which makes it a button. If you want to override that, you can do:

[edit text="My Custom Edit Button" class="my-own-class"]

Or if you only want to override the class (and not the text):

[edit class="my-own-class"]

Numbers Pro only

When using the multiple {articles} tag, you will have a number of articles being output.

Articles Anywhere offers several values based on what place the article has in the list of articles. You can output the values via Data Tags, and you can also use these values in the If Structures.

This way you can conditionally output html/content/data based on the dynamic values. Like the number of the article in the list. If it's the "first" or "last" article. Or if it is an "even" or "uneven" article.

Note: If you use Pagination, the Numbers values will be based on the articles returned in the current page. To get the overall Numbers values regardless of pagination, you can append the respective Data Tag with a _no_pagination suffix.

Totals

The total value contains the number of the articles returned by the {articles} tag in the page.

If you use the per_page="..." attribute to create pagination, you can get the overall number of articles returned with the total_no_pagination value.

When you use the limit="..." attribute, to - for instance - only return 30 articles overall, then you might also want to know (and use) the total number of articles that would have been returned if there was no limit. You can get this value with the total_no_limit value.

Count

The count value contains the number of the article in that set of articles.
So the first article in the page will have a count value of 1. The seventh article in the page will have a count value of 7.

You can - for example - use this count tag to create id or class names. In the HTML/code view of the editor, you could place:

<div class="my_article_[count]">[title]</div>

This example will show the linked title and introtext of the first 3 articles, and only the linked title of the rest:

{articles category="Mice"}[link][title][/link]
{if count <= 3}[introtext]{/if}{/articles}

If you use the per_page="..." attribute to create pagination, you can get the overall number of the article with the count_no_pagination value.
So, if you show 10 articles per page, the first article in the second page will have a count value of 1, and a count_no_pagination value of 11.

First / Last

The first and last values mark the first and last article returned by the {articles} tag in the page.

This example shows how to add a different class name for the first and last articles in the output (in html view):

<div class="my_article {if first}my_first_article{/if} {if last}my_last_article{/if}">

You can of course use this for other things as well, like conditionally showing extra data or html for the first and/or last article.

If you use the per_page="..." attribute to create pagination, you can get the overall first and last article with the first_no_pagination and last_no_pagination values.
So the last value will be true for every last article in each page, while the last_no_pagination value will only be true for the very last article in the last page.

Even / Uneven

The even and uneven values are handy for creating lists that have an alternating class. Like a "zebra-striped" table.

This example shows how to add a different class name for the even and uneven articles in the output (in html view):

<div class="my_article {if even}my_article_even{/if} {if uneven}my_article_uneven{/if}">

The same can be done with an else:

<div class="my_article {if even}my_article_even{else}my_article_uneven{/if}">

Or even shorter with the same result:

<div class="my_article my_article_{if uneven}un{/if}even">

You can of course use this for other things as well, like conditionally showing extra data or html for the even or uneven articles.

Next / Previous

The next value gives the number of the next article in the list. This will return the number of the first article (1) when the current is the last article on the page.

The previous value gives the number of the previous article in the list. This will return the number of the last article when the current is the first on the page.

You can use these to create custom article navigation, or simple anchor links to the previous/next articles.
This is an html example of a blog page with previous/next links:

<p>{articles category="My Category}</p>
<h2><a href="/article-[count]"></a>[title]</h2>
<p>[text]</p>
<p><a href="#article-[previous]">previous</a> <a href="#article-[next]">next</a></p>
<p>{/articles}</p>

The has_next and has_previous values will return a true/false value based on whether there is a next/previous article on the page.
This means that has_previous will only be false for the first article on the page, and the has_next will only be false for the last article on the page.

If you use the per_page="..." attribute to create pagination, you can get the number of the overall previous and next articles with the previous_no_pagination and next_no_pagination values.
This means that has_previous_no_pagination will only be false for the first article on the first page, and the has_next_no_pagination will only be false for the last article on the last page.

Every ...

The every-... values are useful to add extra html or a class name for every n. articles.

Let's say you want to create columns. Then you will need to add extra html or class names to mark the beginning or end of each row.
For this purpose you can use the every-... value.

This example shows how to add an extra closing and opening <div> after every 4th article in the output (in html view):

{if every-4}</div><div>{/if}

Columns

An even more flexible value is the is-...-of-... value.

Just some examples:

  • The is-1-of-3 value will be true for the 1st, 4th, 7th, etc article.
  • The is-3-of-3 value will be true for the 3rd, 6th, 9th, etc article.
  • And the is-2-of-5 value will be true for the 2nd, 7th, 12th, etc article.

This example shows how to add a different class name for every 2nd article when splitting the result in groups of 5:

<div class="my_article {if is-2-of-5}my_special_article{/if}">

See the If Structures section for more information on the {if} tags.

Page Numbers

If you use Pagination, you can output special pagination-based Number Values.

The per_page value contains the number of articles per page set to be returned.

The pages value contains the total number of pages generated by the results. And you can use the page value to return the number of the current page.

The next_page value gives the number of the next page. This will return the number of the first page (1) when the current is the last page.
The previous_page value gives the number of the previous page. This will return the number of the last page when the current is the first page.

The has_next_page and has_previous_page values will return a true/false value based on whether there is a next/previous page.
This means that has_previous_page will only be false for the first page, and the has_next_page will only be false for the last page.

Calculations

Articles Anywhere can even do calculations on numeric Number data tags such as [total], [total_no_limit],[total_no_pagination], [count], [count_no_pagination], [next] and [previous].

For example, where [count] is 10:

[count]    = 10
[count-1]  = 9
[count+10] = 20
[count*3]  = 30
[count/2]  = 5

If Structures

Articles Anywhere allows you to use (simple) if-else structures inside the {articles} tag.

The if structures tag syntax looks like:

{if ...}...{elseif ...}...{else}...{/if}

You can use pretty much any Data Tag inside the if conditions. Especially the Numbers are very useful, as we have seen above.

Check if the data exists or not

You can check whether a data exists (meaning it's NOT empty or false) or not. For instance, to show the readmore tag only if the article has a fulltext, you can do:

{if fulltext}[readmore]{/if}

If you want to show a different readmore text when the article doesn't have a fulltext, you can do:

{if fulltext}[readmore text="Read full story"]{else}[readmore text="See intro"]{/if}

Or the opposite, you can place specific content if the data doesn't exist (meaning it's empty or false):

{if !fulltext}...{if}

Check value of the data

Or check if a data is (or is not) equal to a certain value, like:

{if created_by = 62}...{/if}
{if title != 'Furry Animals'}...{/if}

Articles Anywhere's If Structures support these comparison operators:

  • = Equal
  • != Not equal
  • < Less than
  • > Greater than
  • <= Less than or equal to
  • >= Greater than or equal to
  • IN Value is found in list of values. Example: {if 'Cats' IN tags}
  • NOT IN Value is found in list of values

Multiple Conditions

You can also place multiple conditions in one {if} tag.
If all of the conditions should pass, separate the conditions with AND or &&.
If any of the conditions should pass, separate the conditions with OR or ||.

{if category = 'Cats' && 'furry' IN tags}It's furry and purry{/if}
{if habitat_area = "Asia" OR habitat_area = "America"}It's Asian or American{/if}

Custom Fields Pro only

You can also base your if conditions on custom field values, by simply using the custom field name (for example: nr-of-legs).

Normally when using {if} tags with custom field values, the condition will check the raw value of the custom field (as saved in the database), which is usually the desired behavior.

But in certain cases you might want to check against the rendered output of the custom field instead. You can do so by adding :output to the name of the field:

{if nr-of-legs:output}...{/if}

Examples

Some more useful examples of using If Structures:

For full control via php, you could also use Sourcerer to output the {articles} tag depending on your custom checks.

Nested Articles Pro only

You also have the ability to nest multiple {articles} tags. This can be useful to output another set of articles for every article shown.

To create nested sets, append the {articles} tag of the nested set with an extra name or id, for example -others.

The example below will show one article per category from the parent category "Animals" (so one article from the "Dogs" subcategory, one article from the "Cats" subcategory, and so on). And for each of those articles, it will show a set of articles for the other animals contained in the respective category.

Check out the syntax and the respective result:

Don't forget to close each articles set with a closing tag using the same extra id (in this example: {/articles-others}). If you don't close every set, you will get unwanted results.

Editor Button

You can enter the tags directly into your content. However, to save time typing and remembering what the exact syntax is, Articles Anywhere comes with a handy editor button to place single articles.

You can use this editor button located below the text input area, to place an {article} tag with the desired (basic) data tags into your editor.

You can customize the default data tag settings in the Articles Anywhere system plugin settings.

Limited K2 support Pro only

The PRO version of Articles Anywhere also has LIMITED support for K2 items. To get the K2 item, just add a type="k2" attribute to the tag, like:

{article type="k2" article="Some K2 item"}...{/article}
{article type="k2" article="some-k2-item"}...{/article}
{article type="k2" article="123"}...{/article}

You can also use item, category and tag filters to get multiple K2 items.

To place all K2 items in the K2 category 12 in descending alphabetical order:

{articles type="k2" category="12" ordering="title DESC"}...{/articles}

To place all K2 items with the K2 tag "my-special-tag":

{articles type="k2" tags="my-special-tag"}...{/articles}

Images

K2 does not have an intro or fulltext image. Instead you can use these tags to get the data of the main image attached to the K2 item: [image], [image-url], [thumb], [thumb-url].

You can also get images from content as explained in the main Images section.

Extra fields

K2 has the ability to set extra fields, much like the Custom Fields available in Joomla.
To display these, you can simply use the data tags: [extra-1], [extra-2], etc...
Where that number is the ID number of the extra field.

Editor Button

To enable the option to use K2 content in the editor button popup, you need to make sure the "Use K2 content" option is switched on in the Articles Anywhere system plugin settings.

Limited Support

As stated above, the support for K2 is limited. So you can not use all the bells and whistles mentioned elsewhere in this tutorial.

K2 has a particular way of doing things and storing data in the database which makes support for it very cumbersome.
Also, K2 does not add much to the table anymore, now that Joomla supports Custom Fields out of the box.
So our advise is to switch to Joomla core content (articles, categories, tags, custom fields) as soon as possible.

Settings

Articles Anywhere is packed with options, giving you control over how it works and behaves. Here is the full list of the options you can find in the Articles Anywhere system plugin settings:

Behaviour

Add Ellipsis If enabled, an ellipsis ... will be added to the end of texts that are limited to a number of characters/words.
Increase Hits Select to have the articles hits counter increase when using the [text] or [fulltext] data tags.

Multiple Articles

Articles Limit Define the default maximum articles to return with the articles tag. Set to 0 or leave empty for no limit.
Article Field to Order By Define the default article ordering to use for the articles tag.
Ordering Direction Select the direction you would like Articles to be ordered by.
Include Subcategories If set to None, only articles from the categories in the filter will show. If a number, all articles from the categories in the filter and its the subcategories up to and including that level will show.

Pagination

Enable Pagination Select to add pagination by default.
Articles per Page Set the maximum number of articles per page.
Position Set the position of the navigation. This can be either at the top of the output by Articles Anywhere. Or at the bottom. Or both.
Pagination Results Show or hide pagination results information, for example, "Page 1 of 4".
Page URL Parameter Set the Page URL Parameter to use for the pagination links.

Media

Image Resizing

Resize Images If selected, resized images will be automatically created for images if they do not exist yet.
No: Don't resize images
Standard: Only resize when dimensions are given
Yes:
Always resize images
Can be overruled via the tag like: [image-fulltext resize="true"]
Resize Method Set the type of resizing.
Scale: The resized image will be resized to the maximum width or height maintaining its aspect ratio.
Crop: The resized image will always have the set width and height (both dimensions specified).
Scale using fixed... When "Resize Method" is set to "Scale":
Select whether to resize images using the maximum width or height. The other dimension will be calculated based on the aspect ratio of the original image.
Width Set the width of the resized image in pixels.
Height Set the height of the resized image in pixels.
Folder The folder containing the resized images. This will be a subfolder of the folder containing your original images.
Only on Filetypes Select the filetypes to do resizing on.
Options: GIF, JPG, PNG
JPG Quality The quality of the resized images. Choose from Low, Medium or High. The higher the quality, the larger the resulting files. This only affects jpeg images.
Options: Low, Medium, High

Image Alt/Title Attributes

Cross-Fill If enabled, an empty image alt attribute will be filled with the value of the title attribute. And an empty title attribute will be filled with the value of the alt attribute.
Default Alt/Title Values
for Intro Image, Full Article Image, Category Image, Content Images, Youtube Thumbnails, Media Custom Fields
Select how the image alt and title attributes will automatically be set when empty.
Options: None, File Name, Article Title, Category Title, Custom Field Name
Case Auto Titles Select the way the auto title based on the file name should be cased.
Options: None, lowercase, UPPERCASE, Uppercase first letter, Titlecase (Uppercase All Words), Smart Titlecase (No Uppercasing of Certain Words)
Lowercase Words A comma separated list of words of which the first word should be lowercase in the auto titles.
Default: a,the,to,at,in,with,and,but,or

Ignores

Ignore Language Assignment
for Articles, Categories Pro only and Tags Pro only
If selected, the language assignment will be ignored.
Can be overruled via the tag like: {article article="My Article" ignore_language="true"}
Ignore Access Level
for Articles, Categories Pro only and Tags Pro only
If selected, the access level selection will be ignored.
Can be overruled via the tag like: {article article="My Article" ignore_access="true"}
Ignore Publish State
for Articles, Categories Pro only and Tags Pro only
If selected, the publishing state (and dates) will be ignored.
Can be overruled via the tag like: {article article="My Article" ignore_state="true"}

Security Options Pro only

Articles

These settings have effect on Articles and Categories.

Enable in articles Select whether to enable the use of the syntax in articles.
Security Level Set the level of security. Articles Anywhere tags will be stripped from articles with an owner (creator) below this group level.

Components

These settings have effect on the component area.
You can select in which components Articles Anywhere should not be enabled. Advise is to not allow Articles Anywhere in components that non-backend users can post content in.

Enable in components Select whether to enable the use of the syntax in components.
Disable on Components Select in which components NOT to enable the use of the syntax in. This is a list of your installed frontend components.
Remove in Disabled Components If selected, the plugin syntax will get removed from the component. If not, the original plugins syntax will remain intact.

Other Areas

These settings have effect on areas outside the component area (so in Modules and the rest of the website).

Enable other areas Select whether to enable the use of the syntax in all remaining areas, like the modules. The tag will not be handled/shown in the html head (META tags and such).

Editor Button Options

Button Text This text will be shown in the Editor Button.
Enable in frontend If enabled, it will also be available in the frontend.

Default Data Tag settings

Set the default values of the Data Tag selections for the Articles Anywhere popup

Full Article
Enable Full Article Select to use the full article by default
Enable Custom Layout Optionally set a custom layout to use instead of the default full article layout.
Title
Enable Title Tag Select to insert the [title] tag by default
Title Heading Select the type of heading you want for the title.
Options: None, Heading 1, Heading 2, Heading 3, Heading 4, Heading 5, Heading 6
Add Link Select to wrap the title in [link]...[/link] tags
Intro Image
Enable Intro Image Tag Select to insert the [image-intro] tag by default
Content
Enable Text Tag Select to insert one of the Text tags by default
Text Type Select which text type to use.
All text = Intro + Full text
Options: All text, Intro text, Full text
Maximum text length Set the number of characters to trim the text to (html tags are not counted). Set to 0 or leave empty to disable trimming.
Strip HTML tags Select to strip html tags from the articles text (for raw text with no styling / markup)
Readmore link
Enable Readmore tag Select to insert the [readmore] tag by default
Readmore text Override the default Readmore text. Leave empty to use default.
Class name Override the default Readmore class name. Leave empty to use default (readmore).

Use K2 content Select to add the ability to choose from K2 content in the editor button popup.
Options: No/Yes

Tag Syntax

Article tag The word to be used in the tags.
Note: If you change this, all existing tags will not work anymore.
Articles tag The word to be used in the tags for multiple articles.
Note: If you change this, all existing tags will not work anymore.
Tag Characters The surrounding characters of the tag syntax.
Note: If you change this, all existing tags will not work anymore.
Options: {...}, [...], {{...}}, [[...]], [:...:], [%...%]
Data Tag Characters The surrounding characters of the tag syntax.
Note: If you change this, all existing tags will not work anymore.
Options: {...}, [...], {{...}}, [[...]], [:...:], [%...%]

Advanced

Fix HTML Select to let the extension fix any html structure issues it finds. This is often necessary to deal with surrounding html tags.
Only switch this off if you have issues with this.
Can be overruled via the tag like: {article article="My Article" fixhtml="true"}
Force Content Triggers Enable to make Articles Anywhere pass the content generated through the layout data tags to the content plugins before outputting it. Only enable this if you experience issues. Enabling this can cause content plugins to be triggered multiple times and may affect the rendering speed.
Cache DB Queries Select to cache database queries. This can greatly speed up pages for areas that are not cached by Joomla.
Cache Time The maximum length of time in minutes for a cache file to be stored before it is refreshed.
Leave empty to use the Joomla default cache time found in the Global Configuration.
Place HTML comments By default HTML comments are placed around the output of this extension.
These comments can help you troubleshoot when you don't get the output you expect.
If you prefer to not have these comments in your HTML output, turn this option off.
Registered URL Params Enter the url parameters that you want to get registered.
Different values on these parameters will create unique caches, when using Joomla cache.

For each, you can enter the URL parameter name, and select an input type:
INT: An integer, or an array of integers.
UINT: An unsigned integer, or an array of unsigned integers.
FLOAT: A floating point number, or an array of floating point numbers.
BOOLEAN: A boolean value.
WORD: A string containing A-Z or underscores only (not case sensitive).
ALNUM: A string containing A-Z or 0-9 only (not case sensitive).
CMD: A string containing A-Z, 0-9, underscores, periods or hyphens (not case sensitive).
STRING: A fully decoded and sanitised string (default).
ARRAY: An array.

Installation

You can either install Articles Anywhere by using the core extension manager available in the Joomla! Administrator Control Panel, or by using the powerful Regular Labs Extension Manager.

Note: When updating Articles Anywhere, you do not need to uninstall it first. The package will update all the files automatically.

Keep in mind that when you update to a major new version (or uninstall first), you might lose some configuration settings.

Regular Labs Extension Manager

It is very easy to install/update any Regular Labs Extension using the Regular Labs Extension Manager.

Please see the Tutorial for the Regular Labs Extension Manager for more detailed information...

Joomla! Extension Manager

To install via the Joomla! Extension Manager, just follow these steps:

  1. Log into your Joomla administrator;
  2. In the menu, choose: Extensions >> Extensions;
  3. Choose the tab: Install from Web (or enable it if you haven't done so yet);
  4. Select the search field and enter Articles Anywhere and hit enter;
  5. Click on the Articles Anywhere listing;
  6. Click on Install;
  7. Click on Install to confirm.
Installer Web

Or if you need to install the Pro version or cannot install via the 'Install via Web' method for some reason:

  1. Download the extension install file (.zip);
  2. Log into your Joomla administrator;
  3. In the menu, choose: Extensions >> Extensions;
  4. Choose the tab: Upload Package File;
  5. Click on the Choose File button and select the extension zip;
  6. Click on Upload & Install.
Installer Upload

If you have problems installing Articles Anywhere, please try the manual installation process as described here: docs.joomla.org/Installing_an_extension