If Structures
Articles Anywhere allows you to use (simple) if-else structures inside the {articles}
tag.
Here are some useful examples of using If Structures:
- Output content based on dates values
- Output content based on the number of articles displayed
- Check even/uneven articles displayed
- Check whether an article is access-restricted
- Check whether an article is published or not
- Check whether an article is the current active article
Nested Articles PRO
To create nested sets, append the {articles}
tag of the nested set with an extra name or id, for example -others
.
The example below will show one article per category from the parent category "Animals" (so one article from the "Dogs" subcategory, one article from the "Cats" subcategory, and so on). And for each of those articles, it will show a set of articles for the other animals contained in the respective category.
{articles category="Animals" include_child_categories="true" one_per_category="true" separator="<hr>"}
<h4>[link][title][/link]</h4>
More articles from the "<b>[category]</b>" category:
{articles-others category="[category]" articles="![id]" separator=", "}[link][title][/link]{/articles-others}
{/articles}
Beagle Dog
More articles from the "Dogs" category: Bulldog, German Shepherd, Labrador Retriever
Bengal Cat
More articles from the "Cats" category: Persian Cat, Siamese Cat, Shorthair Cat
Arabian Horse
More articles from the "Horses" category: Morgan Horse, Quarter Horse, Thoroughbred
Don't forget to close each articles set with a closing tag using the same extra id (in this example: {/articles-others}
). If you don't close every set, you will get unwanted results.
Custom Fields PRO
To place the value of a custom field from the current article, simply use:
{article}[name-of-the-field]{/article}
To place the value of a custom field from a different article, just place the title, alias or ID of that article in the {article}
tag:
{article title="Some Other Article"}[name-of-the-field]{/article}
You can also output the label of the custom field.
Here are some examples of outputting Custom Fields in different flavors:
Custom Field value
[name-of-the-field]
Custom Field label
[name-of-the-field label="only"]
Custom Field label: value
[name-of-the-field label="true"]
Custom Field raw value
[name-of-the-field output="value"]
Custom Field value
My Value
Custom Field label
My Label
Custom Field label: value
My Label: My Value
Custom Field raw value
my-value