Giter Club home page Giter Club logo

root-page-injector's Introduction

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.

root-page-injector's People

Contributors

pmichelotti avatar

Stargazers

 avatar Eric avatar

Watchers

James Cloos avatar  avatar

Forkers

markdaugherty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.