Fork me on GitHub
2sxc 9.35 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,

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,

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,

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,

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,

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

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,

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,

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,

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,

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,

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

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"]);
}