Or if you like coding Java better than tags you could do the query in a method 
in the paragraph's model class, getPermanentEmployees() for instance, and refer 
to model.permanentEmployees from your FreeMarker template. You'd probably still 
use a [#list] tag in your template to render the data.

In the paragraph's model class:

----
public Collection<Content> getPermanentEmployees() {
    // Query data repository using QueryUtil for instance
    return permanentEmployees;
}
----

----
[#assign permanentEmployees = model.permanentEmployees!]
[#list permanentEmployees as permanentEmployee]
   [#-- Render permanentEmployee as desired here --]
[/#list]
----

Nils.
________________________________________
Van: [email protected] [[email protected]] namens 
Will Scheidegger [[email protected]]
Verzonden: woensdag 9 maart 2011 11:17
Aan: Magnolia User-List
Onderwerp: Re: [magnolia-user]  Displaying Multiple data items

You can easily use the cms:query Magnolia tag for this, e.g. in Freemarker

[#assign cms=JspTaglibs["cms-taglib"]]
[#assign queryString]...my sql or xpath query...[/#assign]
[@cms.query repository=data" query=queryString type="xpath" var="employees" /]
[#list employees as currEmployee]
...
[/#list]

See
- http://documentation.magnolia-cms.com/reference/templating/freemarker.html -> 
"Using Magnolia Tags"
- 
http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.3.8/magnolia-taglib-cms/tagreference.html#cms:query

Cheers,
-will

On 09.03.2011, at 11:09, Jon RINGWOOD PSE 55500 wrote:


Is it possible to list multiple data items in a paragraph? For instance, using 
the STK example data, could a list of Permanent Employees be created? I know 
the contact paragraph can be used to select an individual data node and then 
display it but it would be really useful to be able to list all data items for 
a specific node.

Thanks

Jon


________________________________
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: 
<[email protected]<mailto:[email protected]>>
----------------------------------------------------------------
This email and any other accompanying document (s) contain information from 
Kent Police, which is confidential or privileged.  The information is intended 
to be for the exclusive use of the individual(s) or bodies to whom it is 
addressed. The content including any subsequent replies could be disclosable if 
relating to a criminal investigation or civil proceedings. If you are not the 
intended recipient, be aware that any disclosure, copying, distribution or use 
of the contents of this information is prohibited. If you have received this 
email in error, please notify us immediately by contacting the sender or 
telephoning 01622 690690.



________________________________
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------
------------------------------------------------------------------------
 VPRO   www.vpro.nl
------------------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to