Created
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.
Geometrixx template
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.

Nodes
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.

Template
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)
COMMENTS
-
Is there a way to include default components in a parsys programmatically via the templates?
-
Thanks for the useful trick - I'll use it for one of the request our clients desired.
-
Hi.. this works for static components but mine is populated dynamically.. any ideas for that
-
How do i make the default components come below the parsys?
-
thanks for information "How to get default components in your parsys
-
Things are very open and intensely clear explanation of issues. was truly information. Your website is very beneficial. Appreciate your sharing.
-
thanks
-
Awesome blog post. Your post touches many urgent problems of our society. It is impossible to be untouched to these problems. Your article gives the light in which we can observe the life. Keep it up.
-
I would like to say thank for sharing this great article. We can’t get this kind of information from
-
I'll use it for one of the request our clients desired.
-
I like baking them using brown sugar nd butter...cannot use cream or half and half lactose intolerant
-
I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles.Keep up the good work!
-
Thanks for keeping us informed
-
Its great to see you taking the time to share this information
-
Alan you are right!!
-
Your article shows you have a lot of background in this topic. Can you direct me to other articles about this? I will recommend this article to my friends as well. Thanks
-
Let's first look at a Geometrixx template and use that template to add default components to the parsys.
-
Let's first look at a Geometrixx template and use that template to add default components to the parsys.
Comments (21)