Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Multipurposing Query based Content

Avatar

Level 3

I have a use case in which I have to create a content object with following fields in AEM 6.2.

1. Image

2. Title

3. Teaser

4. Description

Authors will also tag these content objects with metadata as well.

Our Content team will create hundreds of these content objects.  These content objects would be displayed on 3 different category of pages.

1. In first page: It would display only Image and Title and a link to point to Details page. This page will display multiple content items based on the filter criteria applied on metadata attributes.

2. Details Page: This page will display all the fields from content object and it will display only single content object on one page.

3. Third page will be similar to first page as it will make metadata query to get content objects but it will present the information in Carousel way.

So my question is how can I achieve this in AEM 6.2.

I want to give different presentation to the same content based on where it is used. I thought about using Content Fragments but it will not serve the purpose as it gives plain HTML as the output and it doesn't even have dialog boxes through which content can be entered in separate nodes.

I am also not sure how content object can be published without being associated to a page. Is it even possible in AEM? I havent seen any such example (except Content Fragments which are not really useful for me). On top of that, I have hundreds of these content Objects and I don't think these cannot be attached to a page. 

So what are my options to solve this problem? 

TIA

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

If your number of content objects are less in number then you can put it under the same page, else I will suggest doing the following:

  • Create a dashboard page, that lets you manage all the content objects, like creation and deletion part.
  • Dashboard will have a form for author, that lets author to create content object, on submitting the form, the content object gets created in form of a child page in a hierarchical form may be over time stamp of alphabetical wise under the dashboard page.

The draw back of having one page contain all the object nodes is, it will be too slow for author to edit and manage content on it. Also if you have too many sibling child pages, then you will still run into slowness issues. So its better to keep the structure in a tree wise fashion.

-- Runal

View solution in original post

7 Replies

Avatar

Level 10

These fields you want to work with - do you want to display them in a component - that is a cmponent that displays these data values? First thing i am thinking is why not look at using a HTL component. 

Avatar

Level 3

smacdonald2008 wrote...

These fields you want to work with - do you want to display them in a component - that is a cmponent that displays these data values? First thing i am thinking is why not look at using a HTL component. 

 

As I mentioned in my earlier port, I want to display the information on page, so I would have to use some sort of component only for displaying this information. Following are additional functionality needed in this component than a standard HTL component:

1. Here the content/data should be completely independent of presentation logic as I have to use same content model with different presentation skins in different pages. 

2. This component would make a query to the repository to filter the content objects. 

Any further thoughts?

Avatar

Level 10

To do this - you would need to use Java on the backend of the HTL component. The frontend of the HTL - you would display the data. However - your Java backend that implements WCMUsePojo - you would need to write application logic to address your needs. For example: "This component would make a query to the repository to filter the content objects"

This can be done using AEM API - for example - you can use the JCR API to get nodes and props that you require. . 

Avatar

Level 3

smacdonald2008 wrote...

To do this - you would need to use Java on the backend of the HTL component. The frontend of the HTL - you would display the data. However - your Java backend that implements WCMUsePojo - you would need to write application logic to address your needs. For example: "This component would make a query to the repository to filter the content objects"

This can be done using AEM API - for example - you can use the JCR API to get nodes and props that you require. . 

 

ok, I get that. My next question would be:

What would be the best way to save these content objects in JCR. Will all the content objects (which essentially are JCR nodes only) be attached to one page node and then will make a query to that specific page?

Will it be the right way to do it?

Avatar

Level 10

There are different ways you can go about it. You can put a sub-tree of nodes under a specific page that your app will use if all you want to do is store/update data values. You could look at building a new tree in the JCR to support your app as well. Take a look at David's JCR data model rules in this case -- see: 

https://wiki.apache.org/jackrabbit/DavidsModel

Hope this helps

Avatar

Correct answer by
Community Advisor

If your number of content objects are less in number then you can put it under the same page, else I will suggest doing the following:

  • Create a dashboard page, that lets you manage all the content objects, like creation and deletion part.
  • Dashboard will have a form for author, that lets author to create content object, on submitting the form, the content object gets created in form of a child page in a hierarchical form may be over time stamp of alphabetical wise under the dashboard page.

The draw back of having one page contain all the object nodes is, it will be too slow for author to edit and manage content on it. Also if you have too many sibling child pages, then you will still run into slowness issues. So its better to keep the structure in a tree wise fashion.

-- Runal

Avatar

Level 3

smacdonald2008 wrote...

There are different ways you can go about it. You can put a sub-tree of nodes under a specific page that your app will use if all you want to do is store/update data values. You could look at building a new tree in the JCR to support your app as well. Take a look at David's JCR data model rules in this case -- see: 

https://wiki.apache.org/jackrabbit/DavidsModel

Hope this helps

 

This is helpful. As Runal mentioned, having so many nodes under one page might impact the page performance. So i want to explore the option of building this new tree in JCR. Now how do I create a new tree in the JCR? and How would content authors access that Tree for content Updates?