Tuesday, September 15, 2015

Sitecore parameters on the TreeList template field

The TreeList field in Sitecore is a great way of exposing items in the Sitecore content tree for selection. Not only does it take in a source field (which points to a parent item in the Sitecore content tree), but the source also accepts parameters which control the TreeList itself.


These parameters are built up as querystrings are: param1=X&param2=Y

  • DataSource: A path to where the data source is located
    • datasouce=/Path/To/Items
  • AllowMultipleSelection: Allow the same item to be selected on the TreeList (more than once), this is false (no) by default.
    • allowmultipleselection=yes
  • ExcludeTemplatesForSelection: A comma separated list of template names which are visible in the tree and not able to be selected.
    • excludetemplatesforselection=Template Name,Other Template Name
  • IncludeTemplatesForSelection: A comma separated list of template names which are visible in the tree and able to be selected.
    • includetemplatesforselection=Template Name,Other Template Name
  • ExcludeItemsForDisplay: A comma separated list of item names or IDs which are excluded from display in the content tree.
    • excludeitemsfordisplay=Item Name,Other Item Name
  • IncludeItemsForDisplay: A comma separated list of item names or IDs which are included in the tree.
    • includeitemsfordisplay=Item Name,Other Item Name
  • ExcludeTemplatesForDisplay: A comma separated list of template names which are excluded from the tree.
    • excludetemplatesfordisplay=Template Name,Other Template Name
  • IncludeTemplatesForDisplay: A comma separated list of template names which are included in the tree.
    • includetemplatesfordisplay=Template Name,Other Template Name
  • DatabaseName: Sets the name of the database being referenced.
    • databasename=OtherDataBase

No comments:

Post a Comment