Universal Content Puller Elements is a developer level content display for Universal Content Puller Once installed, you will have Element and Element List content displays.
Universal Content Puller Elements includes some basic elements as diagnostic aids and as examples of how to use Universal Content Puller Elements.
With both elements, if $page is provided the page name will be shown as a heading.
You can download some examples to import at the bottom of this page.
Use the bundled elements as diagnostics and use the examples from the bottom of this page as learning aids. In practice, your own elements will be more practical and end user oriented.
For example:
Universal Content Puller Elements searches out and presents a select control for all /elements in /packages and /application.
Data mapping is split into three sections.
The Basic Data is easy to use. It is what you, as a Concrete CMS developer, are already familiar with and is covered by the concrete CMS documentation.
If you are using Universal Content Puller with an content source pulling from a page or page list, setting Adjust page context to source page will change the context the element is rendered and $page to that of the source page.
The Element List content display takes a list of content from the transform and renders the element once for each item of content.
With that in mind, it supports the usual Universal Content Puller pagination options. Furthermore, the Universal Content Puller Data section (see above) is extended to include the data used to calculate the pagination. For example, an element could be coded to use this data to identify the current index of an item of content.
By default, the Package/Element selector shows all packages that have /elements, their /elements, and /application/elements.
This is constrained by configuration in application/config/generated_overrides/jl_universal_content_puller_elements.php. This configuration file contains 3 lists
You are free to add to these configuration lists to remove clutter from your own element selection, or to remove from these lists if one of your required elements is being filtered unnecessarily.
Some example uses of UCP elements based on a Concrete CMS v8 and v9 installs with sample content.
These pull content from the sample content blog and use the example Element List element to display it in different ways.
For a standard v8 install with Elemental sample content.
UCP Elements Examples for concrete v8.zip
For a standard v9 install with Atomik sample content.
Creating a sidebar for a group of pages without messing about with stacks is an easy use-case for Universal Content Puller.
This sidebar is edited once, within the main addon page for Universal Content Puller.
It is then pulled into all UCP sub-pages using a UCP block.
The Content Source is Parent Page, set to pull the Sidebar area from 2 pages from the top. The Content Transform is Selector, set to remove container and row classes that, when unnecessarily nested, could mess up the Bootstrap grid. The Content Display is Plain, which just outputs the transformed text.
In the advanced settings, sanitization is disabled as we trust the source page and don't want to strip out any formatting or functionality from the pulled sidebar.