cancel
Showing results for 
Search instead for 
Did you mean: 

getCollection-Method in JS-Templates

cfe
Champ in-the-making
Champ in-the-making
Hello,

what im trying to do is to load a specifiv collection in the javascript-part of a template (\WEB_INF\webscripts\global\mytemplate.get.js) without passing any arguments vie the page-templates.

From a predefined template i have the following code:

collectionService.getCollection(context.properties.section.id, args.collection)

What can i enter for:
- context.properties.section.id
- args.collection

to get e.g.
\news\collections\section.articles

I tried several combinations without any luck.

Thank you very much in advance for your help!

greetings,
Chris
3 REPLIES 3

bremmington
Champ on-the-rise
Champ on-the-rise
Sorry for the delay in replying. For some reason I didn't get a handy email telling me about your post.

Probably the easiest way to do this is:

  context.properties.webSite.getSectionByPath("/news/").getAssetCollection("section.articles")

cfe
Champ in-the-making
Champ in-the-making
Hello Brian,

delayed response from myself, as i just returned from holidays.

Thanks for your answer. Your suggestion works fine!

greetings,
Chris

bremmington
Champ on-the-rise
Champ on-the-rise
Good. Thanks for coming back to me. Hope you had a good holiday.  Smiley Happy
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.