Confinity Documentation
  • Latest Version
  • Latest Version
  • Getting Started

    • Introduction
    • Core Concepts
    • Create an Application
    • Glossary
  • Essentials

    • Authentication & SSO
    • Breaking Changes
    • Roslyn Source Analyzers
    • Changelog
    • ConfinityContent
    • ConfinitySelectable
    • Confinity Schedules
    • Data Seeding
    • Development guidelines [WIP]
    • Entity App
    • Entity Form
    • Entity Permissions
    • Frontend Configuration
    • Images
    • Known Issues
    • Localization
    • Migrations
    • Modules [WIP]
    • On-Site Editing
    • Settings
    • Cascade Delete
    • Replication
    • Infrastructure
  • Modules

    • Analytics Module
    • Assets Module
    • Blog Module
    • Cookie Consent Module
    • Forms Module
    • Friendly Captcha (Forms Module )
    • GeoIP Module
    • Htmx
    • Mail Module
    • Mailing Module
    • MediaPlayer Module
    • GoogleMyBusiness Module
    • OpenTelemetry Module
    • Pages Module [WIP]
    • Pattern Library Module
    • SIX Saferpay (worldline) Module
    • Products Module
    • Search Module
    • Wizard Module
  • Guides

    • Create a Custom Entity App Form Element
    • Date and Time
    • Entity Change Listener
    • File Upload / Temp File
    • HTTP security headers
    • conventions [WIP]
    • How to use Confinity with nginx
    • Notifications
    • Nullability
    • Rename Entity
    • Schedules
    • Useful snippets
    • Content Localization
  • Design Guidelines

    • Introduction
    • Page Components
    • Forms Module

On-Site Editing

With the on-site editor, users can edit pages while directly seeing their changes on the corresponding website. For the best on-site experience, the developer has to keep a few things in mind, while developing components.

TagHelpers for On-Site Editing

The following TagHelpers can be used to improve UX while using the on-site editor.

To be able to use the TagHelpers, you have to add the following TagHelpers to your _ViewImports.cshtml file:

@addTagHelper *, Confinity.Pages

Hiding Content in On-Site Editor

You can hide content in the on-site editor with the following TagHelper.

<confinity-onsite-editing-hide>
    <p>This is not visible in on-site editing.</p>
</confinity-onsite-editing-hide>

Show Content Only in On-Site Editor

It's also possible to do the other way around and show certain content only in the on-site editor as follows.

<confinity-onsite-editing-show>
    <p>This is only visible in on-site editing.</p>
</confinity-onsite-editing-show>

Make Lists of Components Editable

If your component contains a list of other components, you may want to be able to add new components to that list. You can achieve that like in the following example.

@foreach (var tab in tabs)
{
    <div role="tabpanel">
        @await Component.InvokeConfinityViewComponentsAsync(tab.Tab.Components)
        <confinity-onsite-editing-property id="@tab.Tab.Id" property-name="@nameof(TabModel.Components)" />
    </div>
}
Prev
Modules [WIP]
Next
Settings