Posts

Showing posts from July, 2019

Create Custom Template for Experience Fragment in AEM

Image
Hello everyone, In this post we will see how to create custom template for Experience Fragment. Note : Here I am using the same BasePage Component for experience fragment template and for page template. Step 1: Go to CRXde and create a Simple Component with Parsys only. Stet 2:  Navigate to /conf/we-retail/settings/wcm/templates and start creating Template. sling:resourceType:/apps/blog/component/BasePage Step 3: Once template is created you have to allow this template under /content/experience-fragments To allow your custom template under /content/experience-fragments navigate /content/experience-fragments this folder will have property  cq:allowedTemplates   edit property and add path of your custom template (/conf/we-retail/settings/wcm/templates/Sample). Step 4: Now start creating Experience fragment using custom template. Step 5: Once Experience fragment is created author it i.e. author the required component/ content

Create Experience fragment in aem

Image
Experience fragment are a new feature introduced in aem 6.3. If different pages are using the same content / component then author can put those component / content in single experience fragment and can use this XF in all the required pages. In this post we will see how to create Experience fragment using existing/out of box template Step 1: Go to AEM start console for me ( http://localhost:4502/aem/start.html ) . Click on Experience Fragment. Once You Click on Experience Fragment it will open the XF console where you can create Folder and Experience Fragment. We create folders as per project requirement Like we are working on XYZ project which is having sites in EN,US,AU, UK so we will create folder as per project structure. Step 2: Once you are done with required Folders creations. Start creating XF. To create XF from create icon drop down select Experience Fragment. Enter the Experience Fragment details Like (Title, Name, Description & tags).

Migration from SCR annotation to OSGI Declarative Service

In this post we will see the migration of aem project from SCR annotation to OSGi Declarative service or R6 annotation. From beginning we were using SCR annotations for backend aem development. From AEM 6.2 R6 annotation are introduced and recommended to used R6 annotation. SCR (Service Component Runtime) Annotations : the maven-scr-plugin uses the SCR annotation from corresponding subproject at Apache felix. All annotations are in the org.apache.felix.scr.annotations package. If you want to use scr annotations in your project you have to use below plugin and dependency <plugin>       <groupId>org.apache.felix</groupId>       <artifactId>maven-scr-plugin</artifactId>        <version>1.7.4</version> </plugin> <dependency>      <groupId>org.apache.felix</groupId>       <artifactId>org.apache.felix.scr.annotations</artifactId>       <version>1.6.0</version>       <scope>provid