Creating Custom AEM Page Template with Adobe Campaign Form Components creating-custom-aem-page-template-with-adobe-campaign-form-components
This page explains how to build a custom page template that uses Adobe Campaign Form components by examining how the Geometrixx-outdoors template ( /apps/geometrixx-outdoors/components/page_campaign_profile
) is implemented, and points you to important information you may need when creating your own custom template.
To create a custom AEM page template using Adobe Campaign Form components, make sure you have the following:
-
Correct resourceSuperType
Make sure the page-component inherits from
mcm/campaign/components/profile
.This is required for the servlets to get and save info
com.day.cq.mcm.campaign.servlets.TemplateListServlet
com.day.cq.mcm.campaign.servlets.SaveProfileServlet
-
ClientContext Settings
When you look at the clientcontext settings (
/etc/designs/geometrixx-outdoors/jcr:content/page_campaign_profile
) you see the following settings:- ClientContext points to
/etc/clientcontext/campaign
- There is also an extra config node.
- ClientContext points to
-
head.jsp (https://experienceleague.adobe.com/apps/geometrixx-outdoors/components/page_campaign_profile/head.jsp?lang=en)
In head.jsp, you see the following lines that use the clientcontext-config and the cloudservice-hook:
code language-none <cq:include path="config" resourceType="cq/personalization/components/clientcontext_optimized/config"/> <sling:include path="contexthub" resourceType="granite/contexthub/components/contexthub"/> <cq:include script="/libs/cq/cloudserviceconfigs/components/servicelibs/servicelibs.jsp"/>
-
body.jsp (https://experienceleague.adobe.com/apps/geometrixx-outdoors/components/page_campaign_profile/body.jsp?lang=en)
In body.jsp, the cloud services are loaded at the bottom of the page:
code language-none <cq:include path="cloudservices" resourceType="cq/cloudserviceconfigs/components/servicecomponents"/>
-
Campaign page properties
To be able to select an Adobe Campaign template the page-properties are extended with the Campaign tab:
/apps/geometrixx-outdoors/components/page_campaign_profile/dialog/items/tabs/items/campaign
-
Template settings.
In the template (
/apps/geometrixx-outdoors/templates/campaign_profile/jcr:content
) you see the following default values:table 0-row-2 1-row-2 acMapping mapRecipient (for Adobe Campaign 6.1), profile (for Adobe Campaign Standard) acTemplateId mail