Load dynamic content into your layouts and create site-wide templates for categories, tags, user and articles using the YOOtheme Pro page builder.
YOOtheme Pro allows you to load content, which is managed in Joomla, from the database into your layouts. This can be the article's title or featured image. Whenever that content changes, it will be automatically updated across your entire website. This is not limited to article fields. Any content from Joomla can be loaded into your layouts.
All builder elements are able to load dynamic content. First, you need to select a content source which defines fields available for mapping. It can be selected in the Advanced tab of an element under Dynamic Content.
For elements which have multiple content items, for example the Grid or the Slideshow element, the Dynamic Content option can be found in the Advanced tab of each item and not of the element itself. This way each item can have a different content source.
The options under Dynamic Content are grouped depending on where the source comes from.
|Page||Content sources which are provided by the page you are browsing. On a single article page, it's the article itself, and on the category page, it's the category itself and its articles.|
|Custom||Content sources which are custom queried. They are independent of the current page. For example, you can load the latest articles or all blog categories into a page.|
|External||External sources which are custom queried. They are independent of the current page. For example, you can load images from a specific folder into a page.|
|Site||A content source with general fields of your site as well as fields of the current logged in user.|
In general, a content source can be Articles, Categories, Tags, Users or Files. YOOtheme Pro also differentiates between a source which contains a single item or multiple items. In addition, a source can have related content sources, for example the article author or tags. Let's go into details.
Depending on the page you are browsing Joomla provides different content sources. These sources are used when creating templates for those pages. For example, the template for the single article page will render different article content depending on which singe article you are browsing.
Here is an overview of all supported pages and their content sources.
|Single Article||The Article itself|
|Category Blog||The Category itself and all its Articles|
|Featured Articles||All featured Articles|
|Tagged Items||The Tag itself and all its Items|
|List All Tags||The Tags themselves|
|Single Contact||The Contact itself including the linked user|
|Search||The Search query itself and all found Items|
|Smart Search||The Smart Search query itself and all found Items|
Note Pages with an Articles source are usually divided into separate pages. The number of articles displayed per page is defined by the total number of Leading Articles, Intro Articles and Links which can be set in the Blog/Featured Layout option in Joomla.
Note By default, tags are linked to the Tagged Items page in Joomla. Unfortunately, it uses the global Default List Limit option to define the number of items per page. That's why it is recommended to use the Compact List of Tagged Items page instead which has a # Items to List option under List Layouts. Simply create a hidden menu item for the Compact List of Tagged Items and select all tags. The links of the selected tags will be automatically redirected to this page.
Note By default, the single contact page in Joomla does not show user articles. To display them, set the Show User Articles to Show in the global configuration.
Custom sources allow you to load custom queried content which is not automatically available on the page you are browsing. For example, you can load the latest articles or all blog categories into a page. Unlike page sources, custom sources are not divided into separate paginated pages.
Following custom sources are available.
|Custom Article||Single||Manually select an article or use filter options to specify which article should be loaded. Filter articles by categories, tags or users. Use the shift or ctrl/cmd key to select multiple categories, tags or users. Set the logical operator to match at least one of the terms, none of the terms or all terms. Additionally, you can load featured articles only.|
|Custom Articles||Multiple||Filter articles by categories, tags and users. Use the shift or ctrl/cmd key to select multiple categories, tags or users. Set the logical operator to match at least one of the terms, none of the terms or all terms. Additionally, you can load featured articles only.|
|Custom Category||Single||Manually select a category.|
|Custom Categories||Multiple||Categories are only loaded from the selected parent category.|
|Custom Tag||Single||Manually select a tag.|
|Custom Tags||Multiple||Tags are only loaded from the selected parent tag.|
|Custom User||Single||Manually select a user.|
|Custom Users||Multiple||Load all users from a selected user group.|
External sources allow you to load custom queried content which is not available in the Joomla database, but comes from the file system. For example, you can load all images from a specific folder. Just like custom sources, external sources are not divided into separate paginated pages.
Following external sources are available.
|File||Single||Manually select a file or a folder or load a file by choosing a path glob pattern and setting the offset. For example, specify the file format using
|Files||Multiple||Load all files from a selected folder or set a path glob pattern to filter files. For example, specify the file format using
The site source allows you to load general fields of your site as well as fields of the current logged in user and guest user.
Most builder elements can only render a single item. Multiple items elements, on the other hand, for example the Grid or the Slideshow element, have the ability to render multiple content items. The content item of the element will render as many items as available in the content source.
If you select a content source which has multiple items, there are two options available to define which items are rendered.
|Start||Set the starting point. If the value is
|Quantity||Limit the number of items. This option is disabled for elements which can only render a single item.|
The combination of the Start and Quantity options allows you to split content source items into different visual layout parts. For example, you can show a number of articles in a hero slideshow followed by a grid showing the rest of the articles.
Note When templating an index or a category page, the Quantity option should only be used when splitting content sources. This is because the number of articles on those pages is already defined in Joomla.
Custom sources have additional options to order their items. Mind that the item order of page sources are defined by Joomla. Depending on whether the custom source is a article, category, tag or a user, there are different order options available.
|Published||Order by published date.|
|Unpublished||Order by unpublished date.|
|Created||Order by created date.|
|Modified||Order by modified date.|
|Hits||Order by number of hits.|
|Article Order||Order by the Joomla article ordering.|
|Featured Articles Order||Order by the Joomla featured articles ordering.|
|Custom Fields||Order by any custom field.|
Set the order direction of the items.
|Descending||Start with the last item.|
|Ascending||Start with the first item.|
Additionally, you can set the ordering from alphabetic to alphanumeric. It treats multi-digit numbers at the beginning of the string as a single character as opposed to alphabetic ordering which treats each digit separately. For example, alphanumeric ordering will sort
2. Chapter before
12. Chapter and not vice versa.
A source can have related content sources, for example the article has a related author and tags. Fields of all related content sources which contain a single item, like the author, are available for mapping together with the fields of the chosen content source. On the other hand, related content sources with multiple items, like article tags, have to be selected under the Multiple Items Source option.
Following related content sources are available for an article.
|Author||Single||The article author|
|Category||Single||The category the article belongs to|
|Tags||Multiple||The tags the article belongs to|
|Category: Child Categories||Multiple||The child categories of the category the article belongs to|
|Category: Tags||Multiple||The tags of the category the article belongs to|
|Related Articles||Multiple||Related articles of the current article, for example articles with the same category. Current article is always excluded.|
Note If Related Articles are selected, additionally set the logical operator for how the articles relate to categories, tags and author. Choose between matching at least one term, all terms or none of the terms.
Following related content sources are available for a category.
|Parent Category||Single||The parent category of the category|
|Child Categories||Multiple||The child categories of the category|
|Tags||Multiple||The tags the category belongs to|
|Parent Category: Child Categories||Multiple||The child categories of the parent category|
|Parent Category: Tags||Multiple||The tags the parent category belongs to|
Once a content source is selected, its fields are available for mapping. To map a content field to an element's field, open the Content tab of an element. Each element field shows a Dynamic button on the right which opens a dropdown with a list of all available content fields.
Select the content field to map it to the element's field. For example, you can map the article’s title and featured image to the title and image fields of the Panel element. Use the search to easily find the needed field.
Instead of the former field, the dynamic field is shown with its name and source.
The following actions are available.
|Dynamic Button||Open a dropdown with all content fields available for mapping.|
|Edit Icon||Open the available field options.|
|Delete Icon||Remove the field mapping. The former field is shown again.|
YOOtheme Pro can load fields from an Article, Category, Tag and User. Custom fields from Joomla are available for mapping as well. While most fields like title, published date or an image simply render their content, some fields are pseudo-fields, which means there is no actual field to fill out. Their content is provided by Joomla or depends on different fields.
|Teaser||Render the intro text if the read more tag is present, otherwise the whole article content.|
|Meta||Render the published date, author and category fields in a formatted string. Category and author are automatically linked to the category page and author's profile page respectively. Mind that the author will only be linked if you create a contact page for the user under Components → Contacts in Joomla.|
|Tags||Render a comma-separated list of all tags which are automatically linked to their tag page.|
|Link||Render the link to the item's page.|
The following pseudo-fields render content which is added by Joomla plugins to the articles. For example, this could be a third-party comments system.
|After Display Title||Render the
|Before Display Content||Render the
|After Display Content||Render the
Important Mind that the Content and Teaser fields should only be mapped on templates and not on individual page layouts. This is because these fields are used to store the actual page content and the builder layout itself.
There are several options available to manipulate the content of a field. Some field types have additional options.
Note The order in which the options are applied is: Date Format → Content Length → Search and Replace → Before and After
All fields have options to add text before and after their content.
|Before||Add text before the field value. For example, if it's an email address, for example
|After||Add text after the field value. For example, if it's a pricing number, for example
Note Text in the Before and After fields can be translated by using the WPML String Translation plugin.
All fields have options to perform a search and replace on their content. This is very powerful and allows advanced manipulation of the field content.
|Search||Select a predefined search pattern or enter a custom string or regular expression to search for. The regular expression has to be enclosed between slashes. For example
|Replace||Enter the replacement string which may contain references. If left empty, the search matches will be removed.|
The predefined URL Protocol pattern (
/https?:\/\//) will remove the HTTP/HTTPS protocol from a URL, if the replacement string is left empty. For example
https://yootheme.com will convert to
yootheme.com. This pattern allows you to link to an external page and display a shortened URL with just one custom field.
Learn more about search and replace in the PHP preg_replace function documentation and about regular expressions in the MDN Regular expressions documentation. The best place to test regular expressions is Regex101.
Text fields have an additional option to limit the content length.
|Content Length||Limit the content length to a number of characters. All HTML elements will be stripped.|
Date fields have an additional option to format the date.
|Date Format||Select a predefined date format or enter a custom format, for example
Learn more about it in the PHP Date function documentation.
The teaser field has an additional option to show the excerpt text instead of the intro text.
|Excerpt||Prefer excerpt to intro text. To use an excerpt field, create a custom field with a name
Meta fields have additional options to display their content.
|Format||Display the meta text in a sentence or a horizontal list.|
|Separator||Set a separator between fields if the format is a list.|
|Link Style||Set the link style.|
|Display||Show or hide fields in the meta text. Additionally, you can choose from which taxonomy the term list is shown.|
|Date Format||Select a predefined date format or enter a custom format, for example
Tags fields have additional options to display their content.
|Separator||Set a separator between tags.|
|Link||Show or hide linking tags.|
|Link Style||Set the link style.|
|Parent Tag||Limit tags by their parent tag.|
YOOtheme Pro can load custom fields from an Article, Category and User. Joomla allows you to add custom fields and field groups to articles and categories in the Article manager and to users in the User manager. Learn more in the official Joomla custom fields documentation.
Custom fields which contain a single item, like the Text field, are available for mapping together with the default content fields and are grouped under Fields or the field group name.
On the other hand, custom fields with multiple items, like the Checkboxes field, have to be selected under the Multiple Items Source option. They are grouped under Fields or the field group name.
Some fields, like the Repeatable field, have an option to allow users to select one or multiple items. Depending on the option, the field will be available for mapping together with the default content fields or has to be selected under the Multiple Items Source option.
While the List and Checkboxes fields are multiple items fields, they are additionally available as a single field which shows their names or values in a comma-separated list.
All Joomla custom fields are supported.
|Calendar||Single||Date picker field||View|
|Checkboxes||Multiple||Checkbox field providing
|Color||Single||Color picker field||View|
|Editor||Single||WYSIWYG editor field||View|
|Integer||Single/Multiple||Select field for integers||View|
|List||Single/Multiple||Select field providing
|List of Images||Single/Multiple||Select field for images of a folder||View|
|Media||Single||Media picker field||View|
|Radio||Single||Radio field providing
|Repeatable||Multiple||Repeat a customizable set of fields||View|
|SQL||Single/Multiple||Select field providing custom queried
|Url||Single||Input field for an URL||View|
|User||Single||User picker field||View|
|Usergroup||Single/Multiple||Select field for user groups||View|
YOOtheme Pro has additional support for the following third-party fields.
|Articles||Single/Multiple||Select field providing all Article fields.||Articles Field|
There are cases in which content sources or mapped fields are invalid. For example, templates loaded from the layout library can use content sources or fields which don't exist in the current Joomla site. Or content sources or fields could also be deleted or renamed in Joomla but still be used in the layout.
Here is a list of all cases when a content source or a field is invalid.
Invalid content sources and fields are highlighted red. To quickly find those cases, the dynamic content status icon is also highlighted red in the YOOtheme builder.
Use conditional logic to display an element depending on a field of a chosen content source. Once a content source is selected, its fields are available under Dynamic Condition. Pick a field to which the condition should apply.
Set a condition, and the element will only be displayed if the condition is met. Some conditions require a value for comparison.
|Is empty||The content of the field is empty|
|Is not empty||The content of the field is not empty|
|Is equal to||The content of the field is equal to the entered value|
|Is not equal to||The content of the field is not equal to the entered value|
|Contains||The content of the field contains the entered value|
|Does not contain||The content of the field does not contain the entered value|
|Less than||The content of the field is less than the entered value|
|Greater than||The content of the field is greater than the entered value|
|Starts with||The content of the field starts with the entered value|
|Does not start with||The content of the field does not start with the entered value|
|Ends with||The content of the field ends with the entered value|
|Does not end with||The content of the field does not end with the entered value|
Learn more about the conditions in the PHP comparison operators documentation. Note that the string comparisons are case-sensitive.
Note For multiple items sources, for example custom sources, which are limited using the quantity option, dynamic conditions apply to the items after the quantity limitation.