Folder Mapping
It’s not uncommon for websites to serve multiple URLs from a single document, displaying dynamic content for large portions of the page without authors having to create each page individually.
Some scenarios where this is useful:
- Commerce websites generating product pages from a product information API
- Blogs with dynamic listing pages of posts for categories or tags
- For a single-page application, mapping requests to a code-bus resource
AEM handles these cases via a folder mapping in the fstab.yaml
file:
mountpoints:
/: https://mycompany.sharepoint.com/:f:/r/sites/WebsiteProjects/Shared%20Documents/sites/company-site
folders:
# Generate everything on and below /products with the "generic-product"
/products: /generic-product
# Generate everything below /categories/ with the "default-category"
# Note the trailing slash here, which differentiates this from the above example
# and applies the mapping only inside the categories folder
/categories/: /categories/default-category
# Use the given html from the code-bus for everything on and below /app
/app: /spa/index.html
Additional Considerations
There are some additional rules applied to bulk metadata for folder mapped pages, see Folder-mapped metadata in the bulk metadata documentation for details.