Conditional StreamFallback Data Source

May 14, 2016 at 7:11 AM
Is it posible to make someting like StreamFallback Data Source,
but that condition is not empty stream but some other flag/content value?

Or there is some other way to conditionaly baypass filter?

Sample diagram:
Image
Coordinator
May 14, 2016 at 11:00 AM
Note: i'm trying to move Q&A to Stack Overflow - so I moved the question to http://stackoverflow.com/questions/37225796/conditional-streamfallback-data-source-dnn-2sxc

and i'll answer it there
May 14, 2016 at 11:57 AM
I tryed

using ToSic.Eav.DataSources
using ToSic.SexyContent

var items1 = AsDynamic(App.Data.Query["GetCategoryMain"]);
or
var items2 = App.Data.Query["GetCategoryMain"];

Bot got error message:
error CS1061: 'ToSic.SexyContent.Interfaces.IAppData' does not contain a definition for 'Query' and no extension method 'Query' accepting a first argument of type 'ToSic.SexyContent.Interfaces.IAppData' could be found


Full error:
Error: System.Web.HttpCompileException (0x80004005): c:!!Dev\DNN\dev.site.t1\httpdocs\Portals\0\2sxc\nnNews_DocumentList.cshtml(30): error CS1061: 'ToSic.SexyContent.Interfaces.IAppData' does not contain a definition for 'Query' and no extension method 'Query' accepting a first argument of type 'ToSic.SexyContent.Interfaces.IAppData' could be found (are you missing a using directive or an assembly reference?) at System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) at ToSic.SexyContent.Engines.RazorEngine.CreateWebPageInstance() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\2Sexy Content Razor\RazorEngine.cs:line 81 at ToSic.SexyContent.Engines.RazorEngine.InitWebpage() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\2Sexy Content Razor\RazorEngine.cs:line 110 at ToSic.SexyContent.Engines.RazorEngine.Init() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\2Sexy Content Razor\RazorEngine.cs:line 27 at ToSic.SexyContent.Engines.EngineBase.Init(Template template, App app, ModuleInfo hostingModule, IDataSource dataSource, InstancePurposes instancePurposes, SxcInstance sexy) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Engines\EngineBase.cs:line 60 at ToSic.SexyContent.SxcInstance.GetRenderingEngine(InstancePurposes renderingPurpose) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\SxcInstance.cs:line 244 at ToSic.SexyContent.SxcInstance.Render() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\SxcInstance.cs:line 200
May 14, 2016 at 5:06 PM
App.Data.Query["query name"]
give me error

But
App.Query["query name"]
is OK for accessing "Default" data.


if I want to access another stream from this query i have to use:

var list = App.Query["Query-Name"]["Stream-Name"].List;
foreach(var item in AsDynamic(list)){
<div>@item.Title</div>
}