-1

I have content stored in XML that I want to convert into Magnolia pages. I can extract the information and create the hierarchy of pages, but manually creating the pages is a pain since there are a lot of them (over 1000). Is there a way to use groovy/java to create the pages? I was hoping to extend whatever Magnolia uses to create pages and send parameters through that way.

For example if I have already parsed the template type, navigation title, etc can create a page without using the dialog? I also want to add components in the same way.

--edit--

I have created a groovy script that creates a new page node in the JCR. I was able to generate the areas by adding a template and previewing the page, but that is not efficent. I can specify the template with groovy, but what would be a good way to generate the areas? I am assuming that the FTL script for the page generated the areas when I previewed it.

TomGraphy
  • 3
  • 3

1 Answers1

0

Same thing as for pages. Use Groovy to create nodes of type mgnl:area under pages and mgnl:component for components under areas (or directly under pages). For page and components you need to set mgnl:template property pointing to template you was to assign. Check documentation on rendering to see explanation on what node types should exist under what parents and what metadata or mixins they expect to have.

Jan
  • 4,369
  • 14
  • 25