how to create a folder in a site? | Community
Skip to main content
Level 8
May 17, 2021
Solved

how to create a folder in a site?

  • May 17, 2021
  • 1 reply
  • 1934 views

we want to group some pages into a folder, none of the pages for folder should appear in the navigation (they are pulled out using servlets).  How do we create a folder in our site, vi source code? NOT via the UI?   We need it in source code so that we can distribute the folder to all the environments, including local dev instances.

Even in the UI, we cant see an option to create folders?

By folder, I mean a parent node in the page hierarchy.  Websites have a hierarchy - e.g. at the top there might be pages such as contact and about us, but there might be an articles node/directory which has lots of child pages in side this.  We have seen sites with this structure in AEM, just don't know how to make it.

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 Umesh_Thakur

It seems like your requirement is not suitable in this scenario:

which ever the project, I worked for, I have not seen any folder specifically in content page path. I have seen the hierarchy even many level of hierarchy but those were of cq:Page type only.

Even we have servlets registered with ResourceType those are also of cq:Page type or nt:unstructured type node but that too under the cq:page only.

So I would suggest take help from empty page template, if needed to create the hierarchy or to separate the page content type within it.

But Still you need to create folder then you can take help from crx/de to create sling:folder in any path or if you want it to be created by code then also you can take help from jcr api to add one node on the specific path with desired type.

 

Hope this will help.

Umesh Thakur

1 reply

Umesh_Thakur
Community Advisor
Umesh_ThakurCommunity AdvisorAccepted solution
Community Advisor
May 17, 2021

It seems like your requirement is not suitable in this scenario:

which ever the project, I worked for, I have not seen any folder specifically in content page path. I have seen the hierarchy even many level of hierarchy but those were of cq:Page type only.

Even we have servlets registered with ResourceType those are also of cq:Page type or nt:unstructured type node but that too under the cq:page only.

So I would suggest take help from empty page template, if needed to create the hierarchy or to separate the page content type within it.

But Still you need to create folder then you can take help from crx/de to create sling:folder in any path or if you want it to be created by code then also you can take help from jcr api to add one node on the specific path with desired type.

 

Hope this will help.

Umesh Thakur

TB3dockAuthor
Level 8
May 17, 2021
are you saying to create child pages of a "directory", you have to use a page as a directory? If so, how do yo stop the parent page being viewed, as its not actually a page.