Skip to content

timabell/PageStructureBuilder

 
 

Repository files navigation

About this fork

This library is provided to assist in creating / organising pages and folders in EpiServer 6.

What's different from upstream

  • Code documentation added
  • Code improved for readability
  • Child page creation / finding turned into public extension methods of PageReference (for independent reuse).

Usage

Build dependencies

As well as referencing this project's dll in your project, you will also need to add this project's dependencies.

Automatic folder hierarchies

  1. Create a page type that implements IOrganizeChildren that will act as folders for your pages
  • Inherit one of the classes in namespace OrganizationTypes or create you own with its own rules.
  1. Build and run your EpiServer application
  2. In the episerver edit mode interface, under structure, add a new page (which will act as your folder), of the type you just created.
  3. Add a new page of any type as a child of the page (folder) you just added, and watch as it is created in the correct place complete with any hierarchy that needed to be built.

Child find / create extension methods

You may find it useful to use the extension methods for finding / creating child pages.

To use these, reference namespace PageStructureBuilder.Extensions and then call one of the following as a method on a PageReference object:

  • GetOrCreateChildPage(pageName)
  • GetExistingChild(pageName)
  • CreateChild(pageName)

User side (i.e. EpiServer Admin users)

The automatically organised pages are used as follows:

  • Create folder (i.e. a page) that is one of the self organising Page Types created by your developers.
  • Create a new page of any type directly inside this new folder (not in any subfolders if they already exist).
  • Watch with wonder as the newly created page jumps into the correct subfolder, which is created as required.

Note that the automatic organisation also applies to pages that are moved into the self-organising folder, so if you move a page into the root of the self-organising folder it will jump back into the folder designated by the developers.

Background

Read the blog entries from the original author

About

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C# 100.0%