How To... Use UDP to Build a Gallery
Build lists of pages, links and files around common tags.
User Defined Properties (UDP) allow site designers to build lists of files, pages, and external links based around common meta tags. Conventionally in Pepperio, dynamic lists are built around a source page, but by using Udp as the source lists are possible built around meta data instead.
The first part of the process is to apply meta tags to the pages, files or links that are candidates to be included in the list. These tags are applied in the 'Page Meta Data' section of the page Properties screen. Add additional meta tag(s) and assign a name and value(s) pair, i.e. name: Flavour, value: Cherry.
When you have done this for all the pages, etc you have laid the groundwork for construction of the list.
1. Construct the LIST snippet.
Create a new snippet and write a LIST tag. With this list specify the src as '_udp'. This list opens a component editor for the application of a formula to determine which elements appear in the list, therefore ensure that the component has a noteditable value of "no" (or is omitted, as this is the default setting). Here is the code for the list:
%LIST%(
type=ul,
src=_udp,
id=gallery_list,
itemtemplate=listitem)%
2. Apply the formula in the editor.
When editing the page, the User is presented with an editable icon that opens the component editor. In here there are options to select the ordering of the list; By editorial date, By publication date or By title, and the direction of the list; Ascending or Descending. There is also a text field where the formula for the list is applied.
Based on the example at the top of this page, this formula would generate a list populated by any pages, files or links that have a 'flavour' meta tag value of "Cherry"...
(flavour = 'cherry')
This formula would generate a list populated by any pages, files or links that have a 'flavour' meta tag value that isn't equivalent to "Cherry"...
(flavour != 'cherry')
The first example can be narrowed down even further. Here the list will only feature items tagged as 'Cherry flavoured Ice Cream'...
(flavour = 'cherry') and (foodstuff = 'Ice Cream')
The full range of operators available are;...
= [is equal to]
!= [isn't equal to]
LIKE [the value is contained within the meta tag, i.e. 'cream' would return both 'ice cream' and 'cream cakes']
There are two statement comparison operators as well...
AND [The results of one statement AND another]
-
OR [The results of one statement OR another]
Note that this method of selecting a list is currently only available via the component editor window. The longer term plan is to apply the formula at both the List tag level (to be pre-determined by the developer) and as an interface element for site visitors.