0

can anybody tell me what am I doing wrong?

I want to retrieve all my alfresco sites with this code (this should work):

model.sites = siteService.listSites(null, null, 0); // return type= List<Site>

And now i want to retrieve this list model.sites in my HTML freemarker template like this:

 <body> ${sites} </body>

How can I view this sites list. I know i am getting it wrong in my ftl, but can't find a solution how to retrieve it.

RobinHo
  • 565
  • 1
  • 9
  • 24

1 Answers1

1

You'll need to loop over the sites in your freemarker. Assuming you wanted a list of the site names, with commas between them, then your freemarker would instead want to look something like:

<body>
  <#list sites as site>
     ${site.shortName}<#if site_has_next>,</#if>
  </#list>
</body>
Gagravarr
  • 47,320
  • 10
  • 111
  • 156