Skip to content

Codifies the concept of root pages within a website and exposes such pages via AEM Sling Models.

License

Notifications You must be signed in to change notification settings

AvionosLLC/root-page-injector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Root Page Injector

Codifies the concept of root pages within a website and exposes such pages via Sling Models.

Root Pages

Most websites present as a tree of pages with rooted branches of content all meeting at a single root - commonly the "Home Page".
Many mechanisms commonly afforded end users rely on knowing where they are in relation to their closest section root as well as the ultimate site root. This project presents the concept of a section root and a site root as technical artifacts and allows their injection via Sling Models.

SiteRootPage

The SiteRootPage is the single root of an entire site. This root is commonly the "Home Page" though the nature of the page is not technically important. A site root may be identified in one of two ways.

  1. By setting the isSiteRoot on the page's page properties to true
  2. By defining a Sling Model implementation of SiteRootPage appropriate to your page's resourceType.

Instances of the SiteRootPage should be adaptable back to Page.

SectionRootPage

The SectionRootPage is the root of a section of a site. It is common for a site to be broken into many coarse grain sections with each section having a content tree below it. A section root may be identified in one of two ways.

  1. By setting the isSectionRoot on the page's page properties to true
  2. By defining a Sling Model implementation of SectionRootPage appropriate to your page's resourceType.

Instances of the SectionRootPage should be adaptable back to Page.

Usage

To obtain an instance of SectionRootPage or SiteRootPage an appropriately typed property simply needs to be annotated as an injected property using Sling Models.

@Inject
private SiteRootPage root;

Rooted Page

The RootedPage API expresses the ability to find Section and Site roots from a starting point as well as finding the ancestral path to those roots (typically needed for capabilities like breadcrumbs).

com.avionos.aem.rootpageinjector.core.models.rootpage.RootedPage may be adapted to from a Resource.

Including in a Project

The core and ui modules may be included as Maven project dependencies.

<dependency>
    <groupId>com.avionos.aem.rootpageinjector</groupId>
    <artifactId>root-page-injector.core</artifactId>
    <version>${rootpage.injector.version}</version>
</dependency>
<dependency>
    <groupId>com.avionos.aem.rootpageinjector</groupId>
    <artifactId>root-page-injector.ui.apps</artifactId>
    <version>${rootpage.injector.version}</version>
    <type>zip</type>
</dependency>

If your project will also control the installation of the Root Page Injector then the UI module's zip package should be included as a sub package of your project's package.

About

Codifies the concept of root pages within a website and exposes such pages via AEM Sling Models.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages