Tutorial:

Introduction

Articles Anywhere is a 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 blog type pages
  • 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, 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.

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 items 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

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="Dog"}[title]{/articles}

This will 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="Dog"}[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="Dog" separator=", "}[title]{/articles}

Will result in:

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

Limit/Range

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. You can also individually define the limit in the {articles} tag by adding a limit="..." attribute.

To place only the first 20 articles in category 'Penguins':

{articles categories="Penguins" limit="20"}...{/articles}

To place only the first 10 articles that have the tag 'Has a tail':

{articles tag="Has a tail" limit="10"}...{/articles}

To show a range of articles not starting from the start, so for instance, show articles 21 to 40, you can do:

{articles category="Cute but Dangerous" limit="21-40"}...{/articles}

Ordering

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 choose from these orderings:

  • ordering Article Manager Order
  • hits Hits
  • title Title
  • id ID
  • alias Alias
  • created Created Date
  • modified Modified Date
  • publish_up Start Publishing Date
  • publish_down Finish Publishing Date
  • random Random

To place all articles in category 12 in descending alphabetical order:

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

To place all articles in categories 'Insects' and 'Spiders' in random order:

{articles categories="Insects,Spiders" ordering="random"}...{/articles}

You can even set a secondary ordering that comes into place when the value of the first order is the same.

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

Output when empty

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 categories="Fish" tag="Has 3 legs" empty="Currently no fish found with legs!"}...{/articles}

Fix HTML

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 categories="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 used for the output.

Note: You can combine any filters to narrow down the resulting list of articles.

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

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

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

Filter Types Pro only

Articles

You can simply give a comma separated list of article titles, aliases or ids of the desired articles using the articles="..." attribute.

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

If your article title contains a comma, either 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':

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

Or using the aliases:

{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 categories="..." attribute in the tag.
You can use the titles, aliases or ids of the desired categories.

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

To also include the articles from all child categories (categories nested under the given category), you can add the include_child_categories="true" attribute.
To only include the articles from the first level of child categories (categories directly nested 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}

Author

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

{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 day they were published, created or modified.

For example, for all articles published on January 1, 2018, use:

{articles publish_up="2018-01-01"}...{/articles}

You can also show all articles posted Before or After a certain date. To do this, use the "Smaller or Larger than..." feature as described in the Special Filter Values section.

Featured

You can make Articles Anywhere output all featured articles by adding the 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. This currently only works with simple values and list values (like checkboxes and multi-selects). 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 fieldname nr-of-legs and you want to filter down to articles that have this values set to 3.

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

Article Data

Like with the custom fields, you can also filter down to any other available attribute saved in the article. As long as it is directly saved in the articles database.
So you can use filters like show_intro="true" to show all articles that have the 'Show Intro' setting specifically set to 'Yes'.
You can use the 'Inspect Element' option of your browser to see what field name to use.

Special Filter Values Pro only

You can filter attributes for specific values like you have seen in above examples. However, you can also use dynamic values.
Negative Values

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

{articles categories="Cats" tags="!Cuddly"}...{/articles}
Smaller or Larger than…

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

For instance, this will show all articles that have a publish_up date greater than 2018:

{articles publish_up=">=2018-01-01"}...{/articles}
Wildcards

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

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

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

The following tag will return all articles that have a title/alias containing 'cat':

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

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

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

The following tag will return all articles that have a tag containing 'bold':

{articles tags="*bold*"}...{/articles}
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 in which you're placing the {articles} plugin tag in, 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 article="!current" to the plugin tag.

Data from Current Article

Data from the article that is being edited / containing the Plugin Tag, is also available to be used inside any Filter.
This can provide 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 values such as this:alias.

{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

 

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.
In case you do want to show unpublished 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"}

Similarly to the above example, here you can use an If Structure 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 categories="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 order or limit) will be applied to the whole tag.

So, for example:

{articles categories="Animals" include_child_categories="true" AND categories="Fruit" AND categories="Monsters" include_child_categories="true" limit="3" order="title"}...{/articles}

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

  • the 'Animals' category (including all sub-categories)
  • AND the 'Fruit' category (NOT including any sub-categories)
  • AND the 'Monsters' category (including all sub-categories).

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, place data type 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}

You can choose from these data types:

Article Data

You can place the following Data Tags related to an article.

  • [article] the entire article. See the Full Article section for a full explanation.
  • [title] the title 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.
  • [id] the ID of the article
  • [created], [publish_up], [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 articles author (Created by)
  • [author-alias] or [created-by-alias] the alias set in the 'Created by Alias' field of the articles
  • [modifier-id], [modifier-name], [modifier-username] the id, name and username of the articles 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: [alias]

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.

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

See the Images section for a full explanation and all the attributes that can be used.

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 all the attributes that can be used.

Tags Pro only

  • [tags] the tags attached to the article Pro only

See the Tags section for a full explanation and all the attributes that can be used.

Custom Fields Pro only

  • [custom_field_name] any custom field (title and) value attached to the article

See the Custom Fields section for a full explanation and all the attributes that can be used.

Edit Link Pro only

  • [edit] a link to the article edit page.

See the Edit Link section for a full explanation

Category Data

You can place the following Data Tags related to the Category attached to the article.

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

Category Links Pro only

  • [category-link]...[/category-link] open and close tag to add a link to the category
  • [category-url] the url to the category (you can also use [category-sefurl] in special cases)

Category Images Pro only

  • [image-category] the image attached to the category.

See the Images section for a full explanation and all the attributes that can be used.

Dynamic Data Pro only

You can also place the following dynamic Data Tags:

Numbers

  • [total] the total number of the article returned by the {articles} tag
  • [total_before_limit] the total number of articles before the limit is applied
  • [count] the number of the article when using the {articles} tag
  • [first] a true/ false value based on whether the article is the first in the returned list of articles
  • [last] a true/ false value based on whether the article is the last in the returned list of articles
  • [next] the number of the next item 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 item 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 item (so can be false for first/last items)
  • [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
  • [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.

Data from Current Article

The [this:...] Data Tags will return any available data of the current article being edited / containing the Plugin Tag.

  • [this:id]
  • [this:title]
  • [this:alias]
  • [this:catid]
  • [this:...] any other available Article Data (must match the column name in the database table).

Data from Current User

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.

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:

{article Some Article}
[title]

[introtext]

[readmore]
{/article}

Full Article

The [article] tag will render the entire 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 creation 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 layout which your template provides, you can define that like this:

[article layout="my_layout"]

You can also make it use the layout from a different template:

[article template="my_template" layout="my_cat_layout"]

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!"]

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 classname. 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] and even Custom Fields of types 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 of the article's fulltext.

[fulltext 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"]

Dates

Any Data Tag that has a date value, such as [created], [publish_up], [modified] , or even calendar Custom Fields, can have the date format specified with this syntax:

[publish_up format="F jS Y"]

That would result in something like: August 21st 2018

The date is format via the PHP date function. You can see what date characters you can use PHP date function.

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

{if created >= '2018-01-01'}...{/if}

You can even compare dates to the current date using the NOW keyword:

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

Images

Intro / Full text images

You can output the full intro image or full text image with:

  • [image-intro]
  • [image-fulltext]

If you want to use the url instead of the entire image tag - to create your own custom image tags for instance - you need to add -url to the tags:

  • [image-intro-url]
  • [image-fulltext-url]

You can also output the other attributes regarding the intro image and full text image:

  • [image-intro-alt]
  • [image-intro-caption]
  • [image-intro-class]
  • [image-fulltext-alt]
  • [image-fulltext-caption]
  • [image-fulltext-class]

Images from content Pro only

The Pro version also 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].

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.

You can use the [image-count] data tag to output the total number of images found in the text. You can also use this value in the If Structures.

Category Images Pro only

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

Like with the intro / fulltext images, you can either output the full image ( <img> tag) with [image-category], or just the url with [image-category-url]

Adding or overriding attributes

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

For instance, you can set the width and height specifically:

[image-intro width="200" height="150"]

Or override the classname:

[image-3 class="my-new-classname"]

Suffixes / Thumbnails

Articles Anywhere doesn't generate thumbnails. However, you can output the image url with a suffix of your choice, so that you can create a thumbnail with that url.

Let's say you have this <img> tag in your content:

<img src="/images/my_special_image.jpg" />

Then you can do [image-1 suffix="_t"] to output:

<img src="/images/my_special_image_t.jpg" />

You will still need to create these thumbnail images yourself though, and name them using the given suffix.

You can also use these shortcuts for suffix="_t" :

[image-...-thumb] is the same as [image-... suffix="_t"]
[image-...-thumb-url] is the same as [image-...-url suffix="_t"]

Videos Pro only

YouTube Videos

The Pro version gives you the ability to place 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 image found in the content, use [youtube-5].
  • [youtube-...-url] to output the url of these images 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-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.

Thumbnail

You can 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]

To add a link to the youtube video, use the [youtube-...-link]...[/youtube-...-link] tags.

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 place 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 image found in the content, use [vimeo-5].
  • [vimeo-...-url] to output the url of these images 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-...-short-url] to output the short url (using the youtu.be domain)
  • [vimeo-...-id]to output only the id of the video.
  • [vimeo-...-link]Go to Vimeo[/vimeo-...-link] to add a link to the vimeo video
  • [vimeo-count]to output the total number o 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 classname:

[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'.

{article Lions}[habitat_area]{/article}

You can also place the value of a custom field inside the content of that same article. Simply place this inside the article:

{article}[habitat_area]{/article}

Field label

By default only the value of the field is shown. But you can also output the label.

This shows only the label of the field:

[habitat_area label="only"]

And this shows both the label and the value of the field, like:
Habitat: Africa

[habitat_area label="true"]

Option values and names

For some custom field types you can have different option values, like for lists, checkboxes and radio buttons.
For every option you can enter a name and its value.

By default the Data Tags will output the option names.

For instance, that 'Habitat' field is a custom list field that has the options Africa, Asia and Europe with respectively the values af, as and eu. And let's say the second option is selected.

Then [habitat_area] will output: Asia

But you might want to output the value as instead, for instance to use in a classname.

To do this, 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 text and value of the custom field.

<div class="my-habitat-class-[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="my-habitat-class-[habitat_area output=&quot;value&quot;]">[habitat_area]</div>

This will result in:

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

Using layouts

By default the label / value will be output as plain text without any html markup around it.
If you want to have Articles Anywhere output the custom field through the layout (like the core Custom Field plugin does), you can do:

[habitat_area layout="true"]

The layout will output both the label and the value (by default). To only output the value, you can do:

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

By default - when using layout="true" - the default layout file will be used to generate the output for the custom fields:

components/com_fields/layouts/field/render.php

However you can override the layout with your own custom file. This way you are in complete control of how the names and values are placed in your content.

Just pass the path to the layout file in the layout="..." attribute (instead of layout="true").

[habitat_area layout="templates/my_template/layouts/habitat_field.php"]

Or if you prefer the dotted syntax, this also works:

[habitat_area layout="templates.my_template.layouts.habitat_field"]
Custom value layouts

By default, multiple values will simply be output separated by the default (comma) separator.

But you can also use a layout file that controls how the value or values are output
This is especially useful for custom fields that can have multiple values, like checkbox lists and multi-select fields.
To set a specific layout for the field value, use the value_layout="..." attribute.

For instance, you create a layout file in your template folder called color_field_values.php.

You can use this layout file by passing the path to that file as the value of the value_layout attribute:

[habitat_area value_layout="templates/my_template/layouts/color_field_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 Text"]

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 classname, which makes it a button. If you want to override that, you can do:

[edit text="My Custom Edit Text" 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 a number of values based on what place the article has in list of articles.

You can output the values via the Data Tag. But 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. Or if it is an 'even' or 'uneven' article. You could - for instance - also use this to create a custom navigation.

Totals

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

When you use the limit="..." attribute, to - for instance - only return 5 articles, 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_before_limit value.

Count

The count value contains the number of the article in that set of articles.
So for the first article count will give you 1. For the seventh article, it will give you 7.

You can -for example - use this count tag to create ids or classnames. 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 article and only the linked title of the rest:

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

First / Last

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

This example shows how to add a different classname 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.

Next / Previous

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

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

You can use these to create pagination type stuff, or anchor links to the next/previous 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 item.
This means that has_previous will only be false for the first item and the has_next will only be false for the last value.

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 classname 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.

Every ...

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

Let's say you want to create columns. Then you will need to add extra html or classnames 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 4rt 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, 4rth, 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 classname 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.

If Structures

Articles Anywhere allows you to use (simple) if-else structures inside the tags.

The if structure tag syntax looks like:

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

This way you can check whether a data types is not empty or false, like:

{if fulltext}...{/if}

Or place specific content if the a data type IS empty or false:

{if !fulltext}...{if}

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

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

For instance, if you only want the readmore tag placed if the article has a fulltext, you can do:

{if fulltext}[readmore]{/if}

Or if you want a different readmore text if the article has a fulltext, you can do:

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

You can place multiple conditions in to 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}

Articles Anywhere supports 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

You can use pretty much any Data Tag as values inside the if conditions.

Especially the Numbers are very useful.

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

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.

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

You can customize the default 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" tag="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 the in-content images 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 my advise is to switch to Joomla core content (articles, categories, tags, custom fields) as soon as possible.

Examples

You can find a lot more cool examples on the Demo Page.

Example: title, intro, read more link

{article 123}[title]
[introtext]
[readmore text=">> READ MORE >>"]{/article}

Example: linked title, first 100 characters of intro and a simple link to the article

{article 123}[link][title][/link] - [introtext limit="100"] - [link]read more...[/link]{/article}

Example in HTML: title with link to article, first 120 characters of (entire) text.

(For use in HTML view of your editor)

{article 123}<h2><a href="/[url]">[title]</a></h2>[textlimit="120"]{/article}

Example: list of linked titles of series of articles Pro only

{articles 101,102,103,104,105}- [link][title][/link]
{/articles}

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

Default Maximum Articles Define the default maximum articles to return when using categories in the articles tag. Set to 0 or leave empty for no limit.
Article Field to Order By Define the default article ordering field when using categories in the articles tag.

Options: Article Order, Hits, Title, ID, Alias, Created Date, Modified Date, Start Publishing Date, Finish Publishing Date, Random
Ordering Direction Select the direction you would like Articles to be ordered by.
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"}
Use 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.
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"}
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.

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.
Classname Override the default Readmore classname. Leave empty to use default (readmore).
Content Type Select what content type to use by default

Options: Joomla!, K2

Advanced

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: {...}, [...], {{...}}, [[...]], [:...:], [%...%]
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.
Enable Full Article
FAQs:

The {article} tags are not being converted

The Articles Anywhere plugin is not published

Check if the Articles Anywhere plugin is published. Go to Extensions >> Plugin manager and search for the system plugin System - Regular Labs - Articles Anywhere. Then publish it.

There is markup on the {article} tags

If you have copy/pasted code directly into your editor, you might also have copied along hidden HTML tags. So this will also cause the {article} tags to break:

{<span>article</span> ...}

Remove the extra styling or other html tags around and in the {article} tags that might cause problems.

The core "Article" editor button gets disabled upon installation

Correct. Joomla has its own Article editor button. Seeing Articles Anywhere has similar - but much better - functionality, Articles Anywhere will disable the Joomla core editor button plugin upon installation / update.

If you want Articles Anywhere to leave the Joomla core editor button plugin alone, just add articlesanywhere_ignore anywhere in the custom_data field of the core Article editor button plugin in the database.
This requires you to do this manually in the database. You can find the Joomla core Article editor button in the #__extensions table. The row you want to edit will have plg_editors-xtd_article in the name column.

%MCEPASTEBIN%
Free vs Pro:

Single Articles::Place any available data from any available article anywhere on your website
Custom styling::Style the data anyway you want by simply styling the data tag
Images::Ability to place intro and fulltext images attached to the article
Select data tags via Editor Button::Option in editor button popup window to select the desired data tags
If structures::Use simple if/else tags to conditionally output text/data

Multiple articles tag::Use a special articles tag to output a series of articles
Show articles based on filters::Show multiple articles filtered by one or more Categories, Tags, Custom Fields, etc...
Control the output::Ability to limit and order the articles
Wildcards::Use the * wildcard to match by part of article titles, categories or tags
Tags::Use the [tags] data tag to output the tags attached to an article
Custom Fields::Place any custom field (feature added in Joomla 3.7) attached to an article
Content Images::Ability to place images found inside the article's content
Videos::Ability to place Youtube and Vimeo videos found inside the article's content
Edit link::Show an edit link for logged in users that have the correct permissions
Advanced Security Control::Disable the ability to use the tags by selected User Group Levels and Components
And more...

Videos:

More videos are coming...

I am working on more videos that will explain more in depth what Articles Anywhere is, how it works and how you can solve stuff with it.
You can also find more in-depth information in the Tutorial and Demo page .

Installing & updating

An overview of the different ways to install and update Articles Anywhere

What is Articles Anywhere ?

A quick intro to Articles Anywhere.

What is Articles Anywhere PRO ?

Coming Soon: What is Articles Anywhere PRO ?

COMING SOON: A quick intro to Articles Anywhere Pro.

Using Articles Anywhere as a CCK

This is my talk at the Joomla World Conference 2017 in Rome.
It gives a great insight of the amazing powers hidden in Articles Anywhere.

Examples:

You can find a multitude of examples on the dedicated Articles Anywhere Demo Page.

Visit the Demo Page >>>

Tutorial DEV:

Introduction

Articles Anywhere is a 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 blog type pages
  • 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, 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.

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 items 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

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="Dog"}[title]{/articles}

This will 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="Dog"}[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="Dog" separator=", "}[title]{/articles}

Will result in:

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

Limit/Range

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. You can also individually define the limit in the {articles} tag by adding a limit="..." attribute.

To place only the first 20 articles in category 'Penguins':

{articles category="Penguins" limit="20"}...{/articles}

To place only the first 10 articles that have the tag 'Has a tail':

{articles tags="Has a tail" limit="10"}...{/articles}

To show a range of articles not starting from the start, so for instance, show articles 21 to 40, you can do:

{articles category="Cute but Dangerous" limit="21-40"}...{/articles}

Ordering

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 choose from these orderings:

  • ordering Article Manager Order
  • hits Hits
  • title Title
  • id ID
  • alias Alias
  • created Created Date
  • modified Modified Date
  • publish_up Start Publishing Date
  • publish_down Finish Publishing Date
  • random Random

To place all articles in category 12 in descending alphabetical order:

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

To place all articles in categories 'Insects' and 'Spiders' in random order:

{articles category="Insects,Spiders" ordering="random"}...{/articles}

You can even set a secondary ordering that comes into place when the value of the first order is the same.

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

Output when empty

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

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 used for the output.

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.

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

Filter Types Pro only

Articles

You can simply give a comma separated list of article titles, aliases or ids of the desired articles using the articles="..." attribute.

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

If your article title contains a comma, either 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':

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

Or using the aliases:

{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 (categories nested under the given category), you can add the include_child_category="true" attribute.
To only include the articles from the first level of child categories (categories directly nested under the given category), you can add the include_child_category="1" attribute.
And use include_child_category="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}

Author

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

{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 day they were published, created or modified.

For example, for all articles published on January 1, 2018, use:

{articles publish_up="2018-01-01"}...{/articles}

You can also show all articles posted Before or After a certain date. To do this, use the "Smaller or Larger than..." feature as described in the Special Filter Values section.

Featured

You can make Articles Anywhere output all featured articles by adding the 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. This currently only works with simple values and list values (like checkboxes and multi-selects). 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 fieldname nr-of-legs and you want to filter down to articles that have this values set to 3.

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

Article Data

Like with the custom fields, you can also filter down to any other available attribute saved in the article. As long as it is directly saved in the articles database.
So you can use filters like show_intro="true" to show all articles that have the 'Show Intro' setting specifically set to 'Yes'.
You can use the 'Inspect Element' option of your browser to see what field name to use.

Special Filter Values Pro only

You can filter attributes for specific values like you have seen in above examples. However, you can also use dynamic values.
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.
All values will be excluded when using !, so the example below will exclude BOTH categories.

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

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

For instance, this will show all articles that have a publish_up date greater than 2018:

{articles publish_up=">=2018-01-01"}...{/articles}
Wildcards

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

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

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

The following tag will return all articles that have a title/alias containing 'cat':

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

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

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

The following tag will return all articles that have a tag containing 'bold':

{articles tags="*bold*"}...{/articles}
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 in which you're placing the {articles} plugin tag in, 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 is being edited / containing the Plugin Tag, is also available to be used inside any Filter.
This can provide 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 values such as this:alias.

{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

 

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.
In case you do want to show unpublished 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"}

Similarly to the above example, here you can use an If Structure 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 order or limit) will be applied to the whole tag.

So, for example:

{articles category="Animals" include_child_category="true" AND category="Fruit" AND category="Monsters" include_child_category="true" limit="3" order="title"}...{/articles}

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

  • the 'Animals' category (including all sub-categories)
  • AND the 'Fruit' category (NOT including any sub-categories)
  • AND the 'Monsters' category (including all sub-categories).

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, place data type 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
  • [text], [introtext], or [fulltext] showing the full text or the intro text of the article. See the Text section for a full explanation.
  • [id] the ID of the article
  • [created], [publish_up], [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 articles author (Created by)
  • [author-alias] or [created-by-alias] the alias set in the 'Created by Alias' field of the articles
  • [modifier-id], [modifier-name], [modifier-username] the id, name and username of the articles 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: [alias]
  • [tags] the tags attached to the article. See the Tags section for a full explanation. Pro only
  • [custom_field_name] any custom field (title and) value attached to the article. See the Custom Fields section for a full explanation. Pro only

Category Data

  • [category-id] or [catid] the id of the category attached to the article
  • [category-title] the title of the category attached to the article
  • [category-alias] the alias 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

The Pro version of Articles Anywhere also has the ability to automatically create resized images. See the Images section for a full explanation and all the attributes that can be used.

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 all the attributes that can be used.

Numbers Pro only

  • [total] the total number of the article returned by the {articles} tag
  • [total_before_limit] the total number of articles before the limit is applied
  • [count] the number of the article when using the {articles} tag
  • [first] a true/ false value based on whether the article is the first in the returned list of articles
  • [last] a true/ false value based on whether the article is the last in the returned list of articles
  • [next] the number of the next item 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 item 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 item (so can be false for first/last items)
  • [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
  • [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.

Data from Current Article Pro only

The [this:...] Data Tags will return any available data of the current article being edited / containing the Plugin Tag.

  • [this:id]
  • [this:title]
  • [this:alias]
  • [this:catid]
  • [this:...] any other available Article Data (must match the column name in the database table).

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.

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:

{article Some Article}
[title]

[introtext]

[readmore]
{/article}

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 creation 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 layout which your template provides, you can define that like this:

[article layout="my_layout"]

You can also make it use the layout from a different template:

[article template="my_template" layout="my_cat_layout"]

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 classname. 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] and even Custom Fields of types 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 of the article's fulltext.

[fulltext 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"]

Dates

Any Data Tag that has a date value, such as [created], [publish_up], [modified] , or even calendar Custom Fields, can have the date format specified with this syntax:

[publish_up format="F jS Y"]

That would result in something like: August 21st 2018

The date is format via the PHP date function. You can see what date characters you can use PHP date function.

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

{if created >= '2018-01-01'}...{/if}

You can even compare dates to the current date using the NOW keyword:

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

Images

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 - add -url to the tag: [image-intro-url] and [image-fulltext-url].

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

Images from content Pro only

The Pro version also 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.

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.

Category Image Pro only

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

Like with the intro / full article images, you can either output the image itself with [image-category], or just the url with [image-category-url]

Adding or overriding attributes

In any [image-...] data 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 classname:

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

Resize Images 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 originals.

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 your specified dimensions..

  • Standard (default)
    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 and output.
    If no specific width or height attributes are found in the data tag, images will be resized based on your 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"]

You don't need to specify both width and height attributes in the [image-...] data tag. 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 always 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, 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"]
LimesOrangesBlueberries
BananasApples
BananasBananasOranges

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

 

Resized image files are saved 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.

In the Articles Anywhere system plugin settings you can also select the filetypes to do resizing on (gif, jpg, png) and set the quality of the resized images. Note that 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.

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 place 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 image found in the content, use [youtube-5].
  • [youtube-...-url] to output the url of these images 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-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.

Thumbnail

You can 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]

To add a link to the youtube video, use the [youtube-...-link]...[/youtube-...-link] tags.

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 place 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 image found in the content, use [vimeo-5].
  • [vimeo-...-url] to output the url of these images 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-...-short-url] to output the short url (using the youtu.be domain)
  • [vimeo-...-id]to output only the id of the video.
  • [vimeo-...-link]Go to Vimeo[/vimeo-...-link] to add a link to the vimeo video
  • [vimeo-count]to output the total number o 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 classname:

[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'.

{article Lions}[habitat_area]{/article}

You can also place the value of a custom field inside the content of that same article. Simply place this inside the article:

{article}[habitat_area]{/article}

Field label

By default only the value of the field is shown. But you can also output the label.

This shows only the label of the field:

[habitat_area label="only"]

And this shows both the label and the value of the field, like:
Habitat: Africa

[habitat_area label="true"]

Option values and names

For some custom field types you can have different option values, like for lists, checkboxes and radio buttons.
For every option you can enter a name and its value.

By default the Data Tags will output the option names.

For instance, that 'Habitat' field is a custom list field that has the options Africa, Asia and Europe with respectively the values af, as and eu. And let's say the second option is selected.

Then [habitat_area] will output: Asia

But you might want to output the value as instead, for instance to use in a classname.

To do this, 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 text and value of the custom field.

<div class="my-habitat-class-[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="my-habitat-class-[habitat_area output=&quot;value&quot;]">[habitat_area]</div>

This will result in:

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

Using layouts

By default the label / value will be output as plain text without any html markup around it.
If you want to have Articles Anywhere output the custom field through the layout (like the core Custom Field plugin does), you can do:

[habitat_area layout="true"]

The layout will output both the label and the value (by default). To only output the value, you can do:

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

By default - when using layout="true" - the default layout file will be used to generate the output for the custom fields:

components/com_fields/layouts/field/render.php

However you can override the layout with your own custom file. This way you are in complete control of how the names and values are placed in your content.

Just pass the path to the layout file in the layout="..." attribute (instead of layout="true").

[habitat_area layout="templates/my_template/layouts/habitat_field.php"]

Or if you prefer the dotted syntax, this also works:

[habitat_area layout="templates.my_template.layouts.habitat_field"]
Custom value layouts

By default, multiple values will simply be output separated by the default (comma) separator.

But you can also use a layout file that controls how the value or values are output
This is especially useful for custom fields that can have multiple values, like checkbox lists and multi-select fields.
To set a specific layout for the field value, use the value_layout="..." attribute.

For instance, you create a layout file in your template folder called color_field_values.php.

You can use this layout file by passing the path to that file as the value of the value_layout attribute:

[habitat_area value_layout="templates/my_template/layouts/color_field_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 classname, 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 a number of values based on what place the article has in list of articles.

You can output the values via the Data Tag. But 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. Or if it is an 'even' or 'uneven' article. You could - for instance - also use this to create a custom navigation.

Totals

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

When you use the limit="..." attribute, to - for instance - only return 5 articles, 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_before_limit value.

Count

The count value contains the number of the article in that set of articles.
So for the first article count will give you 1. For the seventh article, it will give you 7.

You can -for example - use this count tag to create ids or classnames. 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 article and only the linked title of the rest:

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

First / Last

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

This example shows how to add a different classname 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.

Next / Previous

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

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

You can use these to create pagination type stuff, or anchor links to the next/previous 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 item.
This means that has_previous will only be false for the first item and the has_next will only be false for the last value.

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 classname 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.

Every ...

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

Let's say you want to create columns. Then you will need to add extra html or classnames 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 4rt 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, 4rth, 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 classname 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.

If Structures

Articles Anywhere allows you to use (simple) if-else structures inside the tags.

The if structure tag syntax looks like:

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

This way you can check whether a data types is not empty or false, like:

{if fulltext}...{/if}

Or place specific content if the a data type IS empty or false:

{if !fulltext}...{if}

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

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

For instance, if you only want the readmore tag placed if the article has a fulltext, you can do:

{if fulltext}[readmore]{/if}

Or if you want a different readmore text if the article has a fulltext, you can do:

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

You can place multiple conditions in to 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}

Articles Anywhere supports 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

You can use pretty much any Data Tag as values inside the if conditions.

Especially the Numbers are very useful.

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

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.

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

You can customize the default 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 the in-content images 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 my advise is to switch to Joomla core content (articles, categories, tags, custom fields) as soon as possible.

Examples

You can find a lot more cool examples on the Demo Page.

Example: title, intro, read more link

{article 123}[title]
[introtext]
[readmore text=">> READ MORE >>"]{/article}

Example: linked title, first 100 characters of intro and a simple link to the article

{article 123}[link][title][/link] - [introtext limit="100"] - [link]read more...[/link]{/article}

Example in HTML: title with link to article, first 120 characters of (entire) text.

(For use in HTML view of your editor)

{article 123}<h2><a href="/[url]">[title]</a></h2>[textlimit="120"]{/article}

Example: list of linked titles of series of articles Pro only

{articles 101,102,103,104,105}- [link][title][/link]
{/articles}

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

Default Maximum Articles Define the default maximum articles to return when using categories in the articles tag. Set to 0 or leave empty for no limit.
Article Field to Order By Define the default article ordering field when using categories in the articles tag.

Options: Article Order, Hits, Title, ID, Alias, Created Date, Modified Date, Start Publishing Date, Finish Publishing Date, Random
Ordering Direction Select the direction you would like Articles to be ordered by.
Use 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.

Media Pro only

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"]
Crop Select to make the resized image crop the original image.
If selected, the resized image will always have the set width and height.
If not selected, the resized image will be resized to the maximum width or height maintaining its aspect ratio.
Set When "Crop" is set to off:
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

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.
Classname Override the default Readmore classname. Leave empty to use default (readmore).
Use K2 content Select to add the ability to chosse from K2 content in the editor button popup.
Options: No/Yes

Advanced

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: {...}, [...], {{...}}, [[...]], [:...:], [%...%]
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.

Articles Anywhere is a powerful plugin that allows you to 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 blog type pages
  • 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:

It is really easy to use Articles Anywhere.
You simply place a plugin tag in the content wherever you want the article to show.

This example will place the entire Fluffy Kittens article wherever you place this code:

{article Fluffy Kittens}{/article}

This code will only place a large title and the intro text of the article:

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

The PRO version also allows you to place multiple articles based on Filters, like Category, Tags, Custom Fields, etc, by using the {articles} tag.

This example will place linked titles of all articles found in the "Cats" category with a "Hairy" tag:

{articles category="Cats" tags="Hairy"}[link][title][/link]
{/articles}

Articles Anywhere offers a lot more cool features, making it a truly powerful and flexible tool you can use to create all sorts of article-based output, and also comes with a handy editor button to help you insert the code you need.

See the full documentation and watch the videos to find out more...