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.

NOTE
Email and form samples are only available in Geometrixx. Download sample Geometrixx content from Package Share.

To create a custom AEM page template using Adobe Campaign Form components, make sure you have the following:

  1. 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

    chlimage_1-201

  2. 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.

    chlimage_1-202

  3. 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"/>
    
  4. 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"/>
    
  5. 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

    chlimage_1-203

  6. 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

    chlimage_1-204

recommendation-more-help
19ffd973-7af2-44d0-84b5-d547b0dffee2