Last updated March 18, 2013. Created by mitchell on October 5, 2012.
Edited by WiredEscape. Log in to edit this page.
Lists are collections of data objects that can be operated over in a loop. Any group of data items can be treated as a list, for example multi-valued field values or the nodes which reference another node.
To create a list, use the 'Create a variable' action, and select the type of list you want. This action will allow you to set an initial value for the first item; then modifications to the list can be made using the 'Add an item to a list' and 'Remove an item from a list' actions.
Another useful tool for populating lists and performing loop operations is using the Views Rules plugin. This will allow you to use a view that is hardcoded to a set of values or a one that uses contextual filters to be populated by the component rule's parameter.
Comments
How is a list created?
Is there an example somewhere of how to create a list?
I updated the page. What do
I updated the page. What do you think?
Programatically Add Data to List
Hi
I have a date list that I would like to populate using PHP simply because there is no other way to create a series of dates each a week after the first. E.g.
01-01-2010
08-01-2010
15-01-2010
22-01-2010
Is there an example of how to do this via PHP?
I've tried treating the list as an array and add data to it but it doesn't seem to work.
Thanks