📚 Product Knowledge
Finding Information
📖 Docs

Finding Information - Optimizely CMS 12

Exam Area: Area 1 – Product Knowledge (15%)


1. Finding Content in the Edit View

Editors use several mechanisms to locate content:

MethodHow to access
Page TreeLeft panel → Page Tree tab
Search barTop of the navigation panel → type content name
ShortcutGadget → Recently edited / Favourites
Media LibraryLeft panel → Media tab

2. Search in Edit View

Navigation panel search bar:
  → Type content name (partial match supported)
  → Shows matching pages, blocks, and media
  → Click result to navigate to that content

Search limitations in Edit View:


3. Content Reports in Admin

/episerver/cms/admin → Reports
ReportDescription
Link StatusLists pages with broken internal or external links
Link Status (External)Broken external links only
Linked to this pageWhich pages link to the selected page
Changed by userContent changed by a specific user
Unpublished contentDrafts not yet published
Expiring contentContent with a set expiry date

4. Finding Content by URL

// Resolve a URL to a content item
public class UrlLookupService
{
    private readonly IUrlResolver _urlResolver;

    public UrlLookupService(IUrlResolver urlResolver)
    {
        _urlResolver = urlResolver;
    }

    public IContent FindByUrl(string url)
    {
        // Returns the routed content or null
        return _urlResolver.Route(new UrlBuilder(url));
    }
}

5. Finding Content by ID

// ContentReference(id, workId, providerName)
var contentRef = new ContentReference(42);  // Page ID 42

var page = _contentLoader.Get<PageData>(contentRef);

6. Finding Content by Type

// Get all instances of a specific content type
public class ContentFinderService
{
    private readonly IContentModelUsage _contentModelUsage;
    private readonly IContentLoader     _contentLoader;

    public ContentFinderService(
        IContentModelUsage contentModelUsage,
        IContentLoader contentLoader)
    {
        _contentModelUsage = contentModelUsage;
        _contentLoader     = contentLoader;
    }

    public IEnumerable<ArticlePage> GetAllArticlePages()
    {
        var contentType = typeof(ArticlePage);

        // GetLocalUsages returns all content items of this type
        var usages = _contentModelUsage.ListContentOfContentType(
            _contentLoader.GetContentType(contentType));

        return usages
            .Select(u => _contentLoader.Get<IContent>(u.ContentLink))
            .OfType<ArticlePage>();
    }
}

7. GetDescendents (Walk the Tree)

// Get all pages under a specific root
public IEnumerable<IContent> GetAllUnderRoot(ContentReference root)
{
    var descendants = _contentLoader.GetDescendents(root);
    return descendants
        .Select(d => _contentLoader.Get<IContent>(d))
        .Where(c => c is PageData);
}

8. IContentTypeRepository

// Find all registered content types
public class ContentTypeListService
{
    private readonly IContentTypeRepository _contentTypeRepo;

    public ContentTypeListService(IContentTypeRepository contentTypeRepo)
    {
        _contentTypeRepo = contentTypeRepo;
    }

    public IEnumerable<ContentType> GetAllPageTypes()
    {
        return _contentTypeRepo
            .List()
            .Where(ct => typeof(PageData).IsAssignableFrom(ct.ModelType));
    }
}

9. Find with Optimizely Search & Navigation

// Full-text search across all content (requires EPiServer.Find)
var results = _searchClient.Search<PageData>()
    .For("EPiServer CMS")
    .Filter(p => p.Language.Name.Match("en"))
    .OrderByDescending(p => p.Changed)
    .Take(10)
    .GetResult();

Review Questions

  1. What are 2 ways to find content in the Edit View? (Page Tree navigation; Search bar in navigation panel)
  2. Which interface resolves a URL to a content item? (IUrlResolver)
  3. Which interface lists all content items of a specific type? (IContentModelUsage)
  4. What built-in CMS feature is needed for full-text content search? (Optimizely Search & Navigation (EPiServer.Find))
  5. Which method gets all descendants of a page? (IContentLoader.GetDescendents())