How to get default components in your parsys
This blogpost will cover a frequently asked question : "how can I default components in my parsys?". This is often in the use case that you want to present to the author already a pre-defined structure, but still want to have the flexibility to move or delete the components.
Let's first look at a Geometrixx template and use that template to add default components to the parsys.
When you go the this url (http://localhost:4502/siteadmin#/content/geometrixx/en) you can create a new page of the type 'Geometrixx Content Page'
When you open the page you see the parsys area where the author can drag/drop new components on to the page.
For this example I am going to drop two Text components on to the page and will enter some text into the components.
After added the components, go to CRXDELite to inspect the nodes added to your content-page. You see that with the "par" node, two nodes are added for the two text components.
When you expand the template (/apps/geometrixx/templates/contentpage) we are using you see that by default it already contains the jcr:content node.
Here comes the trick
Copy the "par" node from your content page to the template, after this you see the same node structure in your template as you had in the content page.
Create a new page
When you now create a new page based on this 'Geometrixx Content Page' template the nodes will be copied from the template to the page.
When you now open the new page you see the two components in the parsys, and they behave exactly as when they were added by an author
Feike Visser (twitter: @heervisscher)