menu
Logo
  • Why azing?
  • Blog
  • Help
ENarrow_drop_down
  • DE
  • EN
Suche in Checklisten
search
azing Logo ENarrow_drop_down
  • DE
  • EN
  • Why azing?
  • Help
2sxc
drive_folder_upload
  • homeChecklist Templates
  • south
  • fiber_manual_recordCustomize Templates and Content-Types
  • south

folder_sharedRazor Components / Templates

  • homeChecklist Templates
  • south
  • fiber_manual_recordCustomize Templates and Content-Types
  • south

folder_sharedRazor Components / Templates

Folders and checklists

  • check_circleRazorComponent - Migrate from Older Format
  • check_circleRazorComponent - Use new Hover TagToolbar

Parts (0) expand_more

These are small document-parts which are used in other documents. They are not a starting point for any real activity. Because of this, they will be listed further down and the search will not list them unless requested. 

Notes: this assumes you now have 2sxc 10.24 or newer running. You can also just start with step one and reload the page, then fix issues step-by step.

Always Required

  1. Add this to the first line: @inherits ToSic.Sxc.Dnn.RazorComponent
    Note: no semicolon at the end (;). This first line to tells the compiler to use the new base class which enables new features and disables obsolete features. 
  2. Change any @Content.Toolbar to 
    this also applies to other dynamic objects that use .Toolbar
    1. @Edit.TagToolbar(Content) - recommended see this
    2. or @Edit.Toolbar(Content) (this behaves the same as the previous one)

Changes for Content-Lists

  1. Change all ListContent to Header
    The old name ListContent was always confusing, so in RazorComponents we changed it to Header and disabled the use of ListContent. 
  2. Change all ListPresentation or ListContent.Presentation to Header.Presentation

Changes for Data-Code (LINQ and List-Loops)

  1. Change all list-uses of AsDynamic(...) to AsList(...)
    Previously AsDynamic was used both for single-items as well as for lists. The compiler couldn't always figure out what to use, so you had to cast objects - which was nasty. Now you use AsList for lists, and AsDynamic for single items.
    See also AsDynamic(...) - Magic Objects and AsList(...) - Magic Lists
  2. If you ever cast to IEntity, use the new one on ToSic.Eav.Data.IEntity - see this
  3. If you ever had a DynamicEntity cast change that to dynamic - see this
  4. If you ever had to cast to IEnumerable, prefer... 
    to use, use 
    @using Dynlist = System.Collections.Generic.IEnumerable<dynamic>;
    to cast it - in the code it will look a bit like this:
    (person.Awards as Dynlist).Select(a => a.Name)

Changes to jQuery

For performance reasons jQuery isn't automatically included any more. If your code expects to use jQuery, make sure you tell DNN about it.

Changes to CustomizeData or CustomizeSearch

  1. Use Purpose instead of InstancePurpose
  2. The signature of CustomizeSearch has slightly different object types - see docs
Logo
Legal | Content Copyright CC-BY 4.0
bug_reportReport Bug
  • info
  • Links
  • Permissions
code Share
code
URL copied to clipboard.
Embed Checklist close
Copy Copy

If you already have a Razor template from before 2sxc 10.24 and wish to migrate to the new RazorComponent, here's how to do it.

Content Copyright

CC-BY 4.0

Translations

None

2sxc - Content Management for DNN & Oqtane Logo

2sxc - Content Management for DNN & Oqtane

QR-Code
azing.org/2sxc/r/9g6xRMrD
View & Use

Public (can be used by everybody)

Edit & Admin

Default (all members can edit)

This catalog has a simple permission model, where all members have the same permissions. For advanced permissions, upgrade to Enterprise.

Here you can see how this document is used and linked by other documents

Used in (2)

Others referencing this

  1. Migrate to Conventions of 2sxc 11
  2. Migrate from SxcApiController to new ApiController in v10.25+
Uses these (1)

Documents linked from this document

  1. RazorComponent - Use new Hover TagToolbar
How it Behaves

How this document is categorized changes how it behaves.

This is a main document, it is listed normally and appears in search result.

Type

This is a Checklist. Lists are converted into checkboxes.

Get something to say?

Comment to start a discussion or make a note
send

please log on to chat

close

Durchsuche ganz Azing