AEM6.2 Can you create a static page template and editable page templates on the same site? | Community
Skip to main content
Level 2
Jul 29, 2016 8:12 PM UTC

AEM6.2 Can you create a static page template and editable page templates on the same site?

Hello, I'm having trouble creating a static page template on our site that already has editable pages. I'm not sure if I'm just creating the template wrong, missing a required call, or if config templates exist that AEM doesn't check for templates in apps.

I have my static template defined in apps, where this documentation says to define a static template

apps/<site-name>/templates/<template-name>

and my editable templates are in

content/conf/<site-name>/settings/wcm/templates

I've tried adding my static template to the conf templates directory, and it then shows up as an option when creating a new page, but the properties tab during page creation is empty and the create button is grayed out. 

Here is my apps static template .content.xml

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:description="Bio Page" jcr:mixinTypes="[mix:lockable]" jcr:primaryType="cq:Template" jcr:title="Bio Page" allowedPaths="[/content(/.*)?]" ranking="{Long}3"> <jcr:content cq:designPath="/etc/designs/<site>" jcr:primaryType="cq:PageContent" sling:resourceType="<site>/components/structure/static-page/bio" cq:template="/apps/<site>/templates/bio-page"> </jcr:content> </jcr:root>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

rawvarun
New Participant
Apr 6, 2017 5:51 AM UTC

Hi,

You can use both Editable Template and Static Template in same Project.

Regards,

Varun Rawat

Translate
New Participant
Aug 3, 2016 3:22 PM UTC

Make sure you have the path to your static templates as a property of cq:allowedTemplates.

This might be located at the project's root node as a property of jcr:content.

/content/[project]/jcr:content

cq:allowedTemplates="[/conf/[project]/settings/wcm/templates/.*,/apps/[project]/templates/.*]"

Translate
kautuk_sahni
Employee
Aug 2, 2016 8:12 AM UTC

Hi

There should not be any problem in having both templates in a project.

Why do you want to move Static template (Link:- https://docs.adobe.com/docs/en/aem/6-2/develop/templates/page-templates-static.html) out of "apps/", the best practice is to keep it there. So when you will create a page you can use this Template.

On Same fashion, you should create a editable template in /conf/<your-folder>/ Link:- https://docs.adobe.com/docs/en/aem/6-2/develop/templates/page-templates-editable.html

I hope this would help you.

~kautuk

Translate
Kautuk Sahni
smacdonald2008
Level 10
Aug 1, 2016 1:00 PM UTC

"I've tried adding my static template to the conf templates directory"

Place your static templates under /apps as per the documentation.

Most AEM development involves templates that are created under /apps. 

When you create a editable template - there is no Design mode. With static templates defined under /apps - there is a design mode. 

I see no reason why a project cannot have both types of templates.  

Translate
KoblinskiAuthor
Level 2
Aug 1, 2016 12:12 PM UTC

I'm still trying to figure this out. Please let me know if I'm asking in the wrong place.

Translate