Expand my Community achievements bar.

SOLVED

How to allow use of template type from a different project

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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)

Vijayalakshmi_S_0-1637678675463.png

View solution in original post

4 Replies

Avatar

Community Advisor

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

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

Avatar

Community Advisor

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:

 

Vijayalakshmi_S_0-1637596319715.png

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)

Vijayalakshmi_S_1-1637596452109.png

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. 

Avatar

Level 2

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.

Avatar

Correct answer by
Community Advisor

@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)

Vijayalakshmi_S_0-1637678675463.png