Main Content

Magnolia Community Forums: Get help with Magnolia: Access content-app on page

  • bartoszpiskiewicz
    Full name: Bartosz Piƛkiewicz
    Posts: 1
    Last post: Jun 8, 2017 10:41:01 AM
    Registered on: Jun 8, 2017
    Access content-app on page
    #1 by bartoszpiskiewicz on Jun 8, 2017 10:41:01 AM


    I've created a content-app by groovy script. I wonder if there's a possibility to access its data directly from page, without creating component. How could I list all items in my content-app on a website?

  • ahietala
    Full name: Antti Hietala
    Posts: 343
    Last post: Nov 21, 2017 1:46:37 PM
    Re: Access content-app on page
    #2 by ahietala on Jun 8, 2017 11:51:08 AM

    Hi Bartek,

    Yes, you can access your content items from a page template script. You don't necessarily need a component.

    Here's how you would get all tours from our demo Tours app (tours workspace) and render their names in a page template.

    [#assign myTours = cmsfn.contentByPath("/magnolia-travels", "tours")]

    [#list cmsfn.children(myTours, "mgnl:content") as child ]

    Docs that may help: (You can stop after "Creating a page template")


You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon