Creating and Fetching a Settings Item in SCORE

This article is related to a feature introduced in SCORE 2.1

SCORE doesn't use items in the content tree as settings by default, but as an implementation requirement you might want to add an item to the content tree to hold some information.

In addition, you might have settings items scattered into different locations - some that are specific to the tenant, and others that are shared to multiple tenants.  In 2.1 BrainJocks SCORE introduced a feature to allow you to easily organize and access those settings items.

GetLookupSourceItem Rule

Finding the Setting Item from Code - using the SCORE Helper Method

Search Helper
public static Item[] FindSettings(Item currentItem, string settingItemTemplateId)        
{
  // execute a lookup using GetLookupSourceItem pipeline for the settings items with the correct template id
  return LookupSources.GetItems( currentItem,
                                 string.Format("#settings#/*[@@templateid='{0}']", settingItemTemplateId));
}

Finding a Setting Item from a Field Source

Finding an item from a field source (datasource item, rendering parameter) where the pipeline is executed would use the same query:

Example Source Query
query:#settings#/*[@@templateid='<template id of the item you are searching for']