Created

Jun 23, 2012

How to get default components in your parsys

Posted by Feike Visser

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'

parsys-1

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.


parsys-7

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.

parsys-3

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.

parsys-4

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.

parsys-5

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

parsys-6

Feike Visser (twitter: @heervisscher)

COMMENTS

  • By Alan - 10:25 PM on Jul 06, 2012   Reply
    Is there a way to include default components in a parsys programmatically via the templates?
  • By Jim - 6:14 PM on Jul 11, 2012   Reply
    Thanks for the useful trick - I'll use it for one of the request our clients desired.
  • By Moses` - 12:46 PM on Sep 11, 2012   Reply
    Hi.. this works for static components but mine is populated dynamically.. any ideas for that
  • By Moses - 11:37 AM on Sep 12, 2012   Reply
    How do i make the default components come below the parsys?
  • By mutiara kata dan gambar gambar - 12:11 AM on Feb 15, 2013   Reply
    thanks for information "How to get default components in your parsys
  • By k12-education.com - 10:10 AM on Mar 25, 2013   Reply
    Things are very open and intensely clear explanation of issues. was truly information. Your website is very beneficial. Appreciate your sharing.
  • By handyvergleich - 3:21 PM on Mar 28, 2013   Reply
    thanks
  • By Degree Programs - 1:41 PM on Apr 08, 2013   Reply
    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.
  • By a choice insurance - 6:44 AM on Apr 15, 2013   Reply
    I would like to say thank for sharing this great article. We can’t get this kind of information from
  • By dien dan seo - 4:21 AM on Apr 17, 2013   Reply
    I'll use it for one of the request our clients desired.
  • By reparation apple montreal - 4:47 AM on Apr 18, 2013   Reply
    I like baking them using brown sugar nd butter...cannot use cream or half and half lactose intolerant
  • By freewebdesigncompanies - 12:38 PM on Apr 27, 2013   Reply
    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!
  • By nj photo booth - 4:57 PM on Apr 27, 2013   Reply
    Thanks for keeping us informed
  • By wedding photography nj - 9:38 PM on Apr 27, 2013   Reply
    Its great to see you taking the time to share this information
  • By Snoring - 12:37 PM on Apr 28, 2013   Reply
    Alan you are right!!
  • By ampoule votreeclairage - 10:18 PM on May 13, 2013   Reply
    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
  • By driversedguy.tumblr.com - 5:04 PM on May 17, 2013   Reply
    Let's first look at a Geometrixx template and use that template to add default components to the parsys.
  • By things to do in Las Vegas - 11:55 AM on May 19, 2013   Reply
    Let's first look at a Geometrixx template and use that template to add default components to the parsys.