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

2sxc Documentation

We are currently re-working the documentation structure. The new structure will be:

  1. API documentation for Razor/C#, JavaScript (incl. $2sxc and $cms), WebServices, Edit-UIs etc. will be found on the 2sxc wiki.
  2. Features-documentation will be found on this page
  3. Learning tutorials and concepts will be in Learn
  4. Blogs, examples etc. are of course in Blog

Features of 2SexyContent with Details and How-To-Use

Filter by

With the new DataSource called App you can retrieve data from another App. For example, you can query a References-App from another Portal to show the same references again. (added 06.01.00)
Tags: Apps, Data and Data Sources, For experts, Razor, new in 6.x,

This app datasource helps you access data from other apps or just group your information by content-types (like tables) (added 07.00.00)
Tags: Data and Data Sources, DataSource, Visual Query - Data Pipeline Designer, Query (Data/Visual),

Now you can easily get all Categories with App.Data["Category"] or all questions with App.Data["Question"]. You can also use this as the input for further filtering, sorting and more. (added 06.01.00)
Tags: Apps, Content Types, Data and Data Sources, Database, Entities, For experts, Lists, Multi-Language, new in 6.x,

Any visual query you create can also be used from razor using this property. (added 07.00.00)
Tags: Data and Data Sources, Apps, Visual Query - Data Pipeline Designer, For experts, DataSource, Entities, Query (Data/Visual), New in 7.x,

Passing data in query through this DataSource will help you remove many attributes to make your JSON smaller and also keep hidden fields hidden. (added 07.00.00)
Tags: DataSource, Data and Data Sources, New in 7.x, For experts, WebApi,

This data source ensures that duplicate requests are served from the cache and that the query doesn't happen any more. (added 07.02.00)
Tags: Visual Query - Data Pipeline Designer, SQL, DataSource, New in 7.x, WebApi, Query (Data/Visual), Lists, Data and Data Sources, Database, For experts,

Use simple tokens like [QueryString:Person] or [User:UserId] to configure data pipelines. This even allows for fallback-scenarios (like when the querystring doesn't have a configuration, like [QueryString:AppId|[AppSettings:DefaultAppId]] (added 06.00.00)
Tags: Data and Data Sources, Database, Entities, Linking, Lists with Details,

CSVs are a popular file format to sync data from a backend system like an ERP into the web site. Now you can just use the exported file as data, cache it, publish - whatever you want. (added 07.02.00)
Tags: Data and Data Sources, Database, DataSource, For experts, Lists, New in 7.x, Query (Data/Visual), Visual Query - Data Pipeline Designer, SQL,

Supports placing all data in the module into the DNN-Search. This works for simple items (like title/text/image) as well as for lists. The special feature is that it allows you to change how the index works. You could specify an alternate (detail-page) url for each item. (added 06.02.00)
Tags: Apps, Data and Data Sources, Entities, For experts, Razor, new in 6.x, Lists, Lists with Details, Search,

Now you can easily add any kind of data to the pipeline with the DataTableDataSource. This is great for adding XML, RSS, NoSQL sources, Resx-files and much, much more. (added 06.00.06)
Tags: Apps, Data and Data Sources, Database, Entities, For experts, Import/Export, Lists, Lists with Details, new in 6.x, Razor,

Easily access backend data with a DataSource. Attach some filters and viola! you get a very powerfull, configuration based data query system. (added 04.00.00)
Tags: Apps, Lists, Lists with Details, Razor, For experts, Database, Data and Data Sources,

All data (entities) are versioned automatically and can easily be restored whenever you need a previous version. (added 06.00.00)
Tags: Data and Data Sources, Database, Entities, new in 6.x,

To keep things nice and separate data-preparation from data presentation we added a method called CustomizeData(). This is always called before the template is processed - for showing, for JSON delivery and for search-indexing. (added 06.01.00)
Tags: Data and Data Sources, Database, For experts, Razor, new in 6.x, Lists, Lists with Details, Search,

A data source which will deliver Form And List data (formerly known as UdT or User Defined Table) to your templates, razor, tokens or WebAPI / JSON. (added 07.00.00)
Tags: DataSource, Data and Data Sources, For experts, Lists, New in 7.x, Query (Data/Visual),

A DataSource allowing you to add SQL but only run on the DNN Database. It also prevents you from using statements such as Insert and protects you against SQL Injection. (added 07.00.00)
Tags: DataSource, New in 7.x, Query (Data/Visual), Data and Data Sources,

Now you can easily query all or some user profiles to show in user directories or show extracts of users for any kind of use case. Highly cachable :) (added 08.05.00)
Tags: Data and Data Sources, DNN/DotNetNuke, new in 8.x, Query (Data/Visual), Visual Query - Data Pipeline Designer,

All content from 2sxc is 100% cached by default, meaning it will not access the database at all. (added 04.02.00)
Tags: Entities, Apps, For experts, Data and Data Sources,

2sxc provides an extensive, advanced content import/export system to help you migrate from other tools or import data from Excel and other lists. (added 07.00.00)
Tags: New in 7.x, Entities, Data and Data Sources, Import/Export,

In your Queries you can use the In-Token like [In:StreamName:ValueName] to use parameters from existing Content-Items. This is usually used together with Module-Content to allow the editor to configure queries. (added 07.00.00)
Tags: DataSource, For experts, Data and Data Sources, New in 7.x, Query (Data/Visual),

The JavaScript API provides various automation helping you connect data from 2SexyContent with JavaScript. (added 04.00.00)
Tags: JavaScript, Apps, Data and Data Sources, For experts,

You can use strongly typed data sources with safe configuration to supply your templates with any data you need. (added 05.00.00)
Tags: Apps, Content Types, Database, Entities, For experts, Razor, new in 5.x, new in 6.x, Data and Data Sources,

This data source delivers the content-items which were specifically added to a module. It's the default data-source on all modules and also provides Presentation-information. (added 07.00.00)
Tags: New in 7.x, Data and Data Sources, For experts, Query (Data/Visual), DataSource,

You can easily use PetaPoco in Razor Templates with DNN and 2SexyContent. (added 06.00.06)
Tags: Apps, Data and Data Sources, Database, For experts, Razor, new in 6.x, Import/Export,

The new RelationshipFilter helps in list-pages to find all items with a category and similar scenarios. (added 06.01.00)
Tags: Data and Data Sources, Entities, Razor, Linking, Lists with Details,

It was always possible to use SQL data before, but with the new data sources it actually is fun to use and fully integrated. (added 06.00.06)
Tags: Apps, Database, Data and Data Sources, Entities, For experts, Lists, Razor, new in 6.x,

This data source allows you to choose from various data sources. It returns the first one actually containing data - so it's ideal to try various filters and return "All" if none of the filters match. (added 07.00.02)
Tags: DataSource, Data and Data Sources, Query (Data/Visual), For experts,

(added )
Tags: Entities, Database, For experts, new in 6.x, Data and Data Sources,

Use this to filter / find one or more items comparing values like name, category etc. Since 08.05 it also has many comparisons like contains, between, etc. (added 07.00.00)
Tags: Data and Data Sources, DataSource, Entities, For experts, Lists, Lists with Details, new in 8.x, Query (Data/Visual), Visual Query - Data Pipeline Designer,

Look inside

Content Item

These are the values a content-editor can manage.
Name Type Value
Title System.String App Information - Object and Token
Teaser System.String Using the App-Object you can access path information, settings and resources.
AddedInVersion System.String 05.05.00
DescriptionLong System.String <p>This new variable / token was introduced to help templates become flexible.&nbsp;</p> <p>Usage Tokens</p> <ul> <li>[App:Path]/scripts/knockout.js</li> <li>[App:PhysicalPath]</li> <...
ImageTeaser System.String
Image System.String
DocumentedOnPage System.String Page:463
StatusDocumentation System.String 3
StatusDevelopment System.String 10
DesignedContent ToSic.Eav.Data.EntityRelationship
ReplacementDocs null
Tags ToSic.Eav.Data.EntityRelationship 1840,1841,1910,2440
RelatedFeatures ToSic.Eav.Data.EntityRelationship 1831
DemoAppGuid System.String
DemoPage System.String


Presentation Item

These are additional, optional presentation instructions a content-editor can manage. If none are entered, a default set (predefined by the designer) will be used.

No Presentation parameters specified, using default presentation for this item.


Template file

@using DotNetNuke.Entities.Modules
@using ToSic.SexyContent.Search
@using ToSic.Eav.DataSources
@functions
{
    public override void CustomizeData()
    {
        // Don't customize anything, nothing to customize in this case
        //throw new Exception("demo");
        var relationshipFilter = CreateSource<RelationshipFilter>(Data["Default"]);
        relationshipFilter.Relationship = "Tags";
        relationshipFilter.Filter = "[QueryString:Tag]";
        if (relationshipFilter["Default"].List.Count > 0)
        {
            Data.In["Default"] = relationshipFilter["Default"];
        }
    }

    /// <summary>
    /// Populate the search - ensure that each entity has an own url/page
    /// </summary>
    /// <param name="searchInfos"></param>
    /// <param name="moduleInfo"></param>
    /// <param name="startDate"></param>
    public override void CustomizeSearch(Dictionary<string, List<ISearchInfo>> searchInfos, ModuleInfo moduleInfo, DateTime startDate)
    {

        foreach (var si in searchInfos["Default"])
        {
            si.QueryString = "mid=" + moduleInfo.ModuleID + "&feature=" + si.Entity.EntityId;
        }
    }


}@if (Request.QueryString["feature"] == null)
{
    // Note: the code inside _List.cshtml could also be inserted right here
    // I just took it out to make everything a bit easier to read
    // The Render-Page will execute that CSHTML and include all data that is in the current view
	@RenderPage("_2SexyContent Feature - List.cshtml");
}
else
{
    // This one will also execute another CSHTML, but will add a variable with the URL-parameter
	@RenderPage("_2SexyContent Feature - Details.cshtml", Request.QueryString["Feature"]);
}
2serve . 2invent . 2create is 2be.