We have seen how to create a content fragment in the previous post.
Content Fragments can be rendered onto a page by below different ways:
Content Fragments can be rendered onto a page by below different ways:
- Using AEM core components
- Using Custom Sling Model
- Using Servlet to access Content Fragment.
Let's see how to render Content Fragment using AEM Core Components.
Enable AEM core components
Create a new project called “aemquickstart” using Adobe’s project archetype. Below is a maven archetype command to use. This will generate a boilerplate project with the latest version of Core Components.
mvn -B archetype:generate
-D archetypeGroupId=com.adobe.granite.archetypes
-D archetypeArtifactId=aem-project-archetype
-D archetypeVersion=23
-D aemVersion=cloud
-D appTitle="AEM Quickstart"
-D appId="aemquickstart"
-D groupId="com.aemquickstart"
-D frontendModule=general
-D includeExamples=n
Run below maven command to install the package in AEM
mvn clean install -PautoInstallPackage
Content fragment and content fragment list core components under ui.apps sub module
- /aemquickstart/ui.apps/src/main/content/jcr_root/apps/aemquickstart/components/content/contentfragment
- /aemquickstart/ui.apps/src/main/content/jcr_root/apps/aemquickstart/components/content/contentfragmentlist
Let's add these components on to the page.
- Go to AEM Start > Sites > aemquickstart > US > English
- Click on the parsys
- Click the plus icon
- Select Content Fragment
- Edit the content fragment
- Select the "AEM Book" content fragment that we created in the previous post
- Add Title, Description, Release Date and Image elements as shown below.
- Save the dialog.
Now we can see the content fragment info on the page.
- Go to AEM Start > Sites > aemquickstart > US > English
- Click on the parsys
- Click the plus icon
- Select Content Fragment
- Edit the content fragment
- Select the "AEM Book" content fragment that we created in the previous post
- Add Title, Description, Release Date and Image elements as shown below.
- Save the dialog.
Great Article
ReplyDeleteImage Processing Projects
Deep Learning Projects for Final Year
JavaScript Training in Chennai
JavaScript
Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals,
Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer.
Angular Training