Custom Checklist Field

  0 rating
CMS;End users
3/22/2013 2:04:03 AM
4/17/2015 1:40:40 PM
Provider: Sitecore

About

 This Custom Checklist field type provides the following functionality:

    * The field represents a customized checklist.
    * There is a text line above the checklist where a User can see the names of the currently selected Items.
    * The checklist is populated by using the Sitecore Query expression entered into the Source field. 

Documentation

Documentation
  • Documentation > Getting Started with the Custom Checklist Field
    Getting Started with the Custom Checklist Field

    1. Introduction

    This Custom Checklist field type provides the following functionality:

        * The field represents a customized checklist:

    checklist 1

        * There is a text line above the checklist where a User can see the names of the currently selected Items.

        * The checklist is populated by using the Sitecore Query expression entered into the Source field.

    This article also describes how to add Items to the list, regardless of the hierarchy, using query expressions.

    It is also shown how to add Items to the list regardless of the hierarchy using query expressions.

    2. Installation

    The CustomChecklist field is distributed as a standard Sitecore package; hence in order to start using it, you must install the package.

    After the package installation, you will see the CustomChecklist field in the list of Field types.

    checklist 2

     To use the custom field, you should add the following line to the <controlSources> section in the web.config file:

    <source mode="on" namespace="Sitecore.Shell.Extensions" assembly="CustomChecklist"
    prefix="contentExtension"/>

    3. General Description

    After the package installation, you will see that the new field type called customChecklist has been added to System/Field? types. You can add this field to a template section and create Items based on this template.

    checklist 3

     This composite field type consists of two fields: Text field and Checklist field. Text field is read-only and is used for displaying the checked Items. It is useful for checklists which contain a lot of Items. If a checklist holds several Items with the same names, they will be displayed with the numbers in the end. When reading the values from the web database, these are represented as a string containing GUIDs separated by a ”|” separator. For example:

    {707EECFA-BED0-419C-8C8F-20E19B0CAC43}|{ED5E6E79-E6C0-4399-8985-C17AD0E7C8F7}

    4. User Manual

    The example below shows how to use the Custom Checklist field.

        1. Create a tree structure as shown in the picture below

    checklist 4

     Where:

        * The Test CustomChecklist Item is based on the Template which includes a customChecklist field;
        * The ChecklistSource Item and all Items with the Document prefix are based on the Document template;
        * Items with the Folder prefix are based on the Folder template.

    A User can set the conditions that define which Items will be added to the checklist.

    These conditions are set in the Source field of the customChecklist field.

    Sitecore query expressions are used in the Source field.

    4.1. Sample Sitecore Query Expressions

    This section is currently under construction. Please check back later.

    4.1.1. Case 1

    To include all Items with their children under the ChecklistSource Item in your customChecklist field, provide the following expression:

    query:/sitecore/content/Home/ChecklistSource/descendant::*

    checklist 5

    This will generate the following field:

    checklist 6

    4.1.2. Case 2

    To include Items based on the Document template under the ChecklistSource Item, provide the following expression:

    query:/sitecore/content/Home/ChecklistSource/*[@@templatekey='document']/descendant-or-self::*

    This will generate the following field:

    checklist 7

    4.1.4. Case 4

    To include Items under an Item with the name Document2, provide the following expression:

    query:/sitecore/content/Home/ChecklistSource/*[@@name='Document2']/descendant::*

    checklist 8

    This will generate the following field:

    checklist 9

    4.2. Changing the Separator

    checklist 10

     Change the separator between Item names in the Text field of the control by including the &separator= modifier at the end of the Source expression. The example below sets semicolon as the separator for the list of Items:

    query:/sitecore/content/Home/ChecklistSource/*[@@name='Document2']/descendant::* &separator=;

    0
Back
Release notes
The module was moved to the marketplace 21-08-2012
Read more Back
Code examples

Solution screenshots(0)

Upload

Reviews (0)

Sort by: Date Most votes
  • Profile Avatar
    [fullName]

    Level: 0

    x0 x0 x0

    [date]

    [title]

    [text]

    Was this helpful?

    0

Comments (0)

Sort by: Date  Most votes

Leave a Comment

Comment must be field in
Post comment
loader

Write a review

Title can't be empty
Review can't be empty
Post review

Download

Title Description Download Action

Add File