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

Simple Apps allow quick deployment, installation, testing and clean removal without side effects. Install an app, adapt to your needs - simple and standardized, using tokens and razor. (added 06.00.00)
Tags: Entities, Lists, Linking, Razor, Token, Multi-Language, Apps,

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,

The user can choose whether he wants to add an item to a list and immediately show a demo-record (with the [+] button), or just open a dialog which doesn't add anything if he cancels. (added 05.05.01)
Tags: Apps, Entities, Lists, Lists with Details, new in 6.x,

Various features of Apps like the Required (DNN) Version or Path ar explained here (added 06.00.00)
Tags: Apps, DNN/DotNetNuke, new in 6.x, new in 8.x,

Using the App-Object you can access path information, settings and resources. (added 05.05.00)
Tags: Razor, Token, Apps, new in 6.x,

Now apps can use centralized settings and multilingual resources for their templates. Works with tokens and razor. (added 06.00.00)
Tags: Apps, For experts, Multi-Language, new in 6.x, Razor, Token,

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,

Using simple server-side commands, you can create entities, edit and delete them in code. Thanks to this feature, you can create your own edit-dialogs or partial dialogs for workflows and similar. Also create simple or complex feedback forms and more. (added 06.05)
Tags: Apps, Entities, Razor, new in 6.x, Database, For experts, WebApi,

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,

Thanks to Github support you can now version your App in Github (data, templates and assets), and 2sxc will ignore all the temporary Github-parts when exporting the app (added 07.02.00)
Tags: Apps, github, New in 7.x, For experts, for javascript developers, Publishing,

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,

When installing Apps or anything else, everything is done automatically and DNN doesn't need to restart. This is very powerful because in a live large system - downtimes and I-Hope-It-Still-Works-Afterwards are not acceptable. (added 06.00.00)
Tags: Import/Export, new in 6.x, Apps,

With InstancePurpose your code knows if it's running to be templated, for publishing JSON data or for search indexing. (added 06.01.00)
Tags: Apps, Search, new in 6.x, Razor,

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,

Amazingly simple integration with knockoutJS. An amazingly simple data-backend using 2SexyContent, a cool JS-Framework to play with the output - all connected with the Data-Pipeline of 2SexyContent. (added 04.00.00)
Tags: JavaScript, Import/Export, Lists, Lists with Details, Razor, Token, Apps,

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,

Use simple HTML-tags or javascript to create inline or hovering add and edit-buttons (added 06.00.00)
Tags: HTML and CSS, JavaScript, Token, Razor, Apps, new in 6.x, New in 7.x, new in 8.x,

Now you can user @RenderPage to call other Razor-Scripts, and these scripts automatically receive the save Content, List, Presentation etc. variables to work with. This allows you to re-use partial templates. (added 06.00.00)
Tags: Apps, new in 6.x, Razor, Linking,

All views in an app can be protected using permissions - thereby ensuring that certain views can only be used by editors / admins. This allows you to create edit/admin-UIs as needed. (added 07.01.00)
Tags: Apps, Admin and Edit Dialogs, For experts, HTML and CSS, New in 7.x,

Thanks to new permissions you can give anonymous users access to Queries or even allow creating content-items (like feedback forms). (added 07.01.00)
Tags: Admin and Edit Dialogs, Apps, AngularJS, For experts, WebApi, Security, JavaScript, Visual Query - Data Pipeline Designer,

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,

Sometimes you want to pre-fill a new Entity with existing information - like the current date, the users name, or data from another list like a file-ID or infos from an XML-Stream. This is now possible. (added 05.05.01)
Tags: Entities, Lists, Lists with Details, Apps, new in 6.x,

The new quick-dialog shows preview-images for apps, views/templates and content-types. Here's how it works and how you can use it. (added 09.01)
Tags: Apps, Content Types, for designers, new in 9.x,

There are cases where certain parts of an app should be shared across multiple zones / portals. (added 02.00.00)
Tags: Admin and Edit Dialogs, Apps, For beginners, Razor, Token,

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,

Now any view can have a name in the URL - so that a module showing that App can easily change between views just by adding "Details" or "CategoryList" to the URL. Simple and powerful. (added 06.06.00)
Tags: new in 6.x, For beginners, Token, Apps,

The new visual query designer helps you retrieve, filter and sort data for use in any kind of template - be it Tokens, Razor, JavaScript, AngularJS etc. (added 07.00.00)
Tags: Visual Query - Data Pipeline Designer, DataSource, Apps, For experts, New in 7.x, Query (Data/Visual), WebApi,

Thanks to the fully automated WebAPI integration you can easily include and distribute your WebAPIs with you Apps. (added 06.05)
Tags: Apps, For experts, Import/Export, JavaScript, new in 6.x, WebApi, Razor, Token,

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.