Fork me on GitHub
2sxc 8.11 for DNN 7 to 9
Website Builder, Content Manager, App-System: free and amazing - done your way
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,

With the ADAM extension, 2sxc automatically takes care of all content files (like images, pdfs, etc.). This greatly increases user comfort and speed when working with content-files. (added 07.03)
Tags: beta feature, New in 7.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,

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),

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,

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,

To access data from 2SexyContent inside JavaScript, just enable the publish-feature and you will get a JSON-feed with all the data. We recommend to use this together with the JavaScript-API giving you a seamless Sexy-JavaScript experience! (added 05.02.00)
Tags: JavaScript, Design, Lists,

AngularJS Apps in DNN are a bit different than outside DNN, mainly because they are not alone (MAP instead of SPA) and also need to know which module they belong to. 2sxc automates the initialization of everything. (added 07.00.00)
Tags: AngularJS, For experts, JavaScript, New in 7.x, WebApi,

In case something breaks on a large upgrade, please consult this to see when we introduced what breaking changes. (added )
Tags: Breaking Changes, New in 7.x,

2SexyContent automatically bundles and minifies your secondary files as you need it. Also called Client-Dependency in DNN or Enable Optimizations in 2sxc. (added 04.00.00)
Tags: Design, HTML and CSS, JavaScript,

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,

Each portal has it's own virtual data base (VDB) and in it a bunch of Apps, again separated from each other. If you need to, you can access other VDBs... (added 04.00.00)

Since 2sxc 8.4 you can create content-blocks inside other content blocks. This allows you to create list/details scenarios and still use designed 2sxc-content block or even gallery apps inside the details-page. (added 08.04.00)
Tags: Content Types, Design, DNN/DotNetNuke, for designers, For experts, Lists, Lists with Details, new in 8.x,

A content-type defines the structure of an information-set. A news-item has a title, body and date, whereas a person also needs first/last names, birthday, etc. (added 01.00.00)
Tags: Field Configuration, Entities, Content Types, For beginners,

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,

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,

Sometimes you just want to add piece of HTML to your page that will always be the same - like a decorative line. Since you're not adding any data, there is no content-type to choose from. This is where the Design-Element is used. (added 01.00.00)
Tags: Content Types, Design, for designers, HTML and CSS, Images,

Need to know more about @Dnn.Portal, @Dnn.Module.Id, Dnn.User, Dnn.Tab or similar - this is your best starting point. (added 01.00)
Tags: Razor, DNN/DotNetNuke,

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,

Enable or disable various languages in 2sxc. (added 04.00.00)
Tags: Multi-Language, For beginners,

This can now be done in code. (added 06.01.00)
Tags: JavaScript, Razor, new in 6.x,

Export/Import is now available and handles a variety of complex scenarios. It can match languages, re-link files and much more. (added 05.04.00)
Tags: Import/Export, Content Types, Entities, Images, Linking, Multi-Language,

Use this input-type to provide editors with an icon picker. It also provides icon search and more. (added 08.03.07)
Tags: for designers, Design, Editing, Field Configuration, new in 8.x, Images, HTML and CSS,

This input-type is for creating url-parts which are safe, lower-case and without special characters. It prevents bad input and can automatically be populated based on another field - like the title. Use it to define URLs for News, Blogs, Artices, Real-Estate-Items and more. (added 08.03.05)
Tags: Admin and Edit Dialogs, Content Types, Editing, Linking, Lists, new in 8.x, Field Configuration,

The entity field type is to establish relationships between content-items, both 1:1 and 1:n. This can be a lookup-relationship like 'Author', a parent-information like 'ManagedBy', a list of shared children like 'Tags' or a list of un-shared children like 'recipe-steps'. (added 02.00)
Tags: beta feature,

Each field type has special features and ways to use it. We try to keep all options/feature listed in our documentation. (added 01.00.00)
Tags: Field Configuration, Content Types, Relationships,

You can now specify if the user should see a file, page or image-picker, and which one is default. (added 05.04.00)
Tags: Field Configuration, Linking, Images, new in 5.x, new in 6.x,

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,

UI to help users choose GPS coordinates for addresses and similar. Automatically finds a previously entered address and allows to manually change pin. (added 05.04.00)
Tags: Field Configuration,

Hide all complicated settings like Administration from the content-editor by creating a user group called 2sxc Designers. (added 03.00)
Tags: For beginners, For experts, Editing,

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,

Awesome Image-Resizer with really neat features. (added 05.03.00)
Tags: Images, HTML and CSS, For beginners, Design, Token, Razor, Linking, Lightbox,

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,

A hovering mini-toolbar tells the user where he can add new content-blocks or apps. This works in normal view mode and is super-fast and elegant. (added 08.04.00)
Tags: Editing, DNN/DotNetNuke, for designers, new in 8.x,

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,

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,

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,

Once you apply a list to a template, you suddenly have multile items presented - maybe as a table or as a designed list. What you then often need is a way to add a title before that or create settings for the way the list is presented. (added 03.00.00)
Tags: Razor, Token, Lists, Lists with Details, For beginners,

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,

Designed content can be one item, or it can be an entire list of items. This is very easy to do. (added 03.00.00)
Tags: Razor, Token, Lists, Design, For beginners,

With the simple toolbar you can enhance the editing experience. (added 03.00.00)
Tags: Token, Razor, For beginners,

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,

To use module-data like ModuleID in [Token] templates (important for JSON-feeds, Details-Links and more) we added a [Module:...] value provider. (added 05.02.00)
Tags: HTML and CSS, Token, Linking, JavaScript,

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,

2sxc offers powerfull - we believe the best possible - multi-language implementation. (added 04.00.00)
Tags: Multi-Language, For beginners,

Point to a 2SexyContent-Page with some extra parameters, and all HTML around the 2SexyContent will disappear. This helps create details-pages in lightboxes or dynamic areas of the HTML, or even allows you to produce a manual JSON-Feed without any HTML around it. (added 04.00.00)
Tags: Design, HTML and CSS, Linking,

Now you can use npm (nodeJS package manager) and Gulp/Grunt when developing your 2sxc-Apps. This helps you create better code and automate lots of working steps. (added 07.02.00)
Tags: New in 7.x, AngularJS, JavaScript, For experts, for javascript developers,

Use 2SexyContent to create lists and then show cool detail pages in lightboxes or otherwise. All SEO-optimized. (added 04.00.00)
Tags: Razor, Lightbox, Linking, Lists, Lists with Details,

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,

Links will still work even after moving pages and files in DNN. They also still work when you rename pages or files. (added 05.04.00)
Tags: Field Configuration, HTML and CSS, Linking, Import/Export, Multi-Language,

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,

To use query-string parameters like ?showrecord=37 (important for detail-pages or filtering stuff) we added a [QueryString:...] value provider. (added 05.02.00)
Tags: Design, Token, Linking,

To make content editing even faster - and consistent across modules and inner-content - we introduced the hovering quick-edit toolbar. (added 08.04.00)
Tags: Admin and Edit Dialogs, Editing, DNN/DotNetNuke, new in 8.x,

Now you can connect entities (like authors and books) in awesome ways. Also extremely usefull for tagging and similar scenarios. (added 05.03.00)
Tags: Lists, Linking, Field Configuration, Entities, Razor, Relationships,

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,

Now 2sxc offers a simple REST API so that you can access content like .../app-content/Feedback/342 to perform all kinds of actions using JavaScript. (added 07.01.00)
Tags: AngularJS, Content Types, Import/Export, JavaScript, New in 7.x, WebApi,

You can create templates that allow configuration with the Presentation-Element. For example, you could configure image-size or placement, click-behavior or show/hide things in your template. (added 03.00.00)
Tags: Content Types, Lists, Razor, Token,

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,

A DataSource allowing you to add SQL to run on any Database. It also prevents you from using statements such as Insert and protects you against SQL Injection. Note that it's currently not available in the Visual Query Designer. (added 07.00.00)
Tags: Database, DataSource, SQL, For experts, New in 7.x, Query (Data/Visual),

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,

Tokens offer a way to use default-values if a token is empty. Ideal for queries or simple texts like "Name Unknown". (added 06.00.00)
Tags: new in 6.x, Token, Query (Data/Visual),

Stacking tokens within tokens allows you to choose between many tokens and also implement multi-language default-values. (added 07.00.00)
Tags: Token, For experts, New in 7.x, Query (Data/Visual),

2sxc comes with two built in view engines. The Token-Engine uses simple placeholders like [Content:Title] and allows you to do amazing things - with very simple technologies. (added 01.00.00)
Tags: Token, Design, For beginners, for designers, for javascript developers, AngularJS, HTML and CSS, JavaScript, Lists, Multi-Language, Visual Query - Data Pipeline Designer,

(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,

Create vCards based on 2SexyContent-Data. Very easy to use. (added 05.02.00)
Tags: Design, HTML and CSS, Images, Import/Export, Linking,

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
Tags ToSic.Eav.Data.EntityRelationship 1840, 1841, 1910, 2440
RelatedFeatures ToSic.Eav.Data.EntityRelationship 1831
DemoAppGuid System.String
DemoPage System.String
DesignedContent ToSic.Eav.Data.EntityRelationship
ReplacementDocs null


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.