Fork me on GitHub
2sxc 9.33 for DNN 7 to 9
Website Builder, Content Manager, App-System: open-source and amazing
You are here: Home  >  Docs  >  Feature

Token Stacking to choose best Token

Introduced in Version 07.00.00

Tokens look like this

  • [Content:LastName]
  • [Event:Date]
  • [QueryString:Category]

When you use Token Fallback it can look like this:

  • [Content:LastName||Last Name unknown]
  • [Event:Date||no date]
  • [QueryString:Category||All]

This is not enough in many cases - so we implemented Token Stacking to allow features like

  1. Multi-Language Default-Values (like in App:Resources)
  2. Configurable Defaults values (like in App:Settings)
  3. Default values which the editor can configure
  4. Sequence of checking which factor to apply, like "Check Url-Param first, otherwise use module-configuration; if all fails use App-Settings"

This is done as follows

  • Using App-Resources to provide multi-language fallback-text: [Content:LastName||[App:Resources:NameUnknown]] 
  • Using App-Settings to provide the default filter: [QueryString:Category||[App:Settings:DefaultCategory]]
  • Using a value from a content-item the content-editor changed in a dialog (see also the In-ValueProvider): [QueryString:Category||[In:Content:DefaultCategory]]
  • Creating a chain of try-this-else-try-that
    [QueryString:Category||[QueryString:Cat||[In:ModuleConfig:Category||[App:Settings:DefaultCat]]]]

Have fun!

Tags for this feature