How to allow use of template type from a different project | Community
Skip to main content
Level 2
November 22, 2021
Solved

How to allow use of template type from a different project

  • November 22, 2021
  • 2 replies
  • 1653 views

We need to use Template Types from a Base Project in our new Project.

I know I can achieve this by Copy pasting the template type in my new project, but I am looking a solution that involves allowedPath or allowedTemplates or allowedTemplate-type properties, if there is any?

Please suggest.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijayalakshmi_S

@saukaush 

If you have template-type defined in /conf/demo and expect that to be available when you create template under /conf/wknd-events, it won't happen straight forward with a property. 

Per the resolution hierarchy, if you choose a common place like /conf/global and have all template-types that you like to re-use in there, then this would work. 

That's the reason why I mentioned if it is within resolution hierarchy, we can re-use. With this feasibility + based on your project structure + reuse requirement + considering long run need, you can decide accordingly. 

 

Screenshot : (To showcase that it is not just for OOTB template-types)

I have copy-pasted the empty template-type from /conf/demo to /conf/global (amended the title just for identifying)

2 replies

Kiran_Vedantam
Community Advisor
Community Advisor
November 22, 2021

Hi @saukaush 

 

As per the documentation, you can only copy and paste the new template created in your desired location.

 

https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/templates/page-templates-editable.html?lang=en#creating-template-types

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

Vijayalakshmi_S
Level 10
November 22, 2021

Hi @saukaush,

If your Base project is within the configuration (/conf) resolving look up hierarchy, then we can make use of property named mergeList or sling:configCollectionInherit (type Boolean set to true)

Example : Per the configuration resolving order mentioned here in official doc

  • If you can choose to hold all your Base project template-types in say, /conf/global -> then individual project folder like /conf/wknd-events/settings/wcm/template-types/jcr:content can have the property named mergeList [Boolean] -> true
    • With this in place, we need not define any template-types under wknd-events. When you try to create a template type from being in wknd-events (from Tools -> Templates console in the UI), you will have all the template-types available as part of /conf/global to choose from. 

Sample screenshots:

 

With this in place, I don't have anything in /conf/global nor in /apps. Then per the resolution order, it finally checks in /libs and brings in  OOTB template-types. (as shown in below screenshot)

Note : If you have any specific template-type defined as part of wknd-events, with this property in place -> it will bring in current conf's resources as well as the ones from inheritance hierarchy. 

Along the similar lines, if you could decide/design and have within the resolution hierarchy, you can reuse template-types, instead of copy-paste. 

saukaushAuthor
Level 2
November 23, 2021

Hi @vijayalakshmi_s , Thanks for the suggestion. But this works if we want to include OOB template types. My requirement is to include the Template types from another custom project.

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
November 23, 2021

@saukaush 

If you have template-type defined in /conf/demo and expect that to be available when you create template under /conf/wknd-events, it won't happen straight forward with a property. 

Per the resolution hierarchy, if you choose a common place like /conf/global and have all template-types that you like to re-use in there, then this would work. 

That's the reason why I mentioned if it is within resolution hierarchy, we can re-use. With this feasibility + based on your project structure + reuse requirement + considering long run need, you can decide accordingly. 

 

Screenshot : (To showcase that it is not just for OOTB template-types)

I have copy-pasted the empty template-type from /conf/demo to /conf/global (amended the title just for identifying)