Logo
Logo
  • Blazor CMS Home
  • Oqtane Tutorials
  • Blazor CMS Home
  • Oqtane Tutorials
Oqtane Tutorials
Oqtane Tutorials

Content Items / Entities

Tutorial Home › Content
Working with Entity (Item) Values
#2 Working with Block Contents
The <img> Tag and Different Image Formats
Requirements
  • 2sxc 12.08
Resources
  • App Data
  • App Query
  • Content

Working with Block Contents

In most cases a template will run in a context - so something prepared data for the template, which should now be visualized. These examples assume you're working with 2sxc, which let's editors work with content - and your template only needs to visualize it. The current content item (if it's just one) is always available on the variable called Content. It's a dynamic object, so you can just type things like @Content.FirstName to access the properties.

The samples can differ based on your Razor base class or if you're running an old version.
Switch to Strong-Typed (2sxc 17.06+) Switch to Typed (2sxc 16+) Switch to Dynamic (Razor14 or below)

Show Entity Values from the current Data

Showing values from Data (aka. Entities) is very easy. Normally they are accessed through Item (new Razor) or DynamicEntity (older Razor) objects. 

Work with Content Items - MyItem

MyItem is the object which contains the first thing added by the editor on the current block.

Work with List of Items - MyItems

 

 

Working with Entity (Item) Values
#2 Working with Block Contents
The <img> Tag and Different Image Formats
  • 2sic internet solutions
  • Langäulistrasse 62, 9470 Buchs SG, Switzerland
  • +41 81 750 67 77
Login