Fork me on GitHub
2sxc 9.0 for DNN 7 to 9
Website Builder, Content Manager, App-System: free and amazing - done your way

Configuration Injection in the Data Pipeline

Introduced in Version 06.00.00

Most data pipelines need some kind of configuration - be it the Id to filter for, a sort-order to change etc. which can change on the fly. You could code this in Razor, but we believe the correct way is to do this by configuration. There are various benefits in this approach - from safety to performance (we can optimize the pipelines) and more. 

Because of this, each pipeline will parse the values specified through a property provider called the ConfigurationProvider. This in turn will check if it recognizes any placeholders (recursively) and try to resolve them. 

Some Examples

  • EntityId = "[QueryString:Id]" on a page /Details.aspx?id=25 will be resolved to EntityId = "25"
  • EntityId = "[QueryString:Id]" on a page /Details.aspx?id=25,573,22 will be resolved to EntityId = "25,573,22"
  • EntityId = "[QueryString:Id]" on a page /Details.aspx will be resolved to EntityId = ""
  • EntityId = "[QueryString:Id|[AppSettings:DefaultId]]" on /Details.aspx will be resolved to the EntityId = "42" // the predefined ID in App-Settings
  • EntityId = "2939,[QueryString:Id]" on the page /Details.aspx?id=25 would be resolved EntityId = "2939,25"

Property Providers Available in 2SexyContent 6.0

  1. App - system-values for the app, like Path, ..., 
  2. AppSettings - properties vary because each app can have different settings
  3. AppResources - note that it is available, but you shouldn't use this, since it shouldn't be used for settings!
  4. QueryString - properties vary based on URL-Parameters after the ?
  5. Form (todo)
  6. Server (todo)
  7. Module (todo) - properties listed in the DNN Wiki
  8. User (todo) -  properties listed in the DNN Wiki
  9. Tab (Page) (todo) -  properties listed in the DNN Wiki 

Exact Syntax

In general you can insert these token-like placeholder anywhere in the string-value. The following would all be valid:

  • "[source:key]"
  • "27,402,[Source:Key],0305,[OtherSource:OtherKey]"

Each placeholder is built using the following possibilities

  • [Source:Key] - the required components - like [Module:ModuleId]
  • [Source:Key|Format] - .net format string - this is mainly used for tokens inside templates, not usually for Configuration Injection
  • [Source:Key|Fallback] - what to use if nothing found - [QueryString:Id|0] or [QueryString:Id|[QueryString:AppId]]
  • Fallback can be done multiple times, like
    [QueryString:Id|[QueryString:OldIdParam|[AppSettings:DefaultId]]]

Tags for this feature

2serve . 2invent . 2create is 2be.