What is this module

The module itself installs conventions into Orchard to allow you to create inline editable shapes.

Enabling Module

To enable the module you need to enable the feature "Inline Editing"

How To

To inline edit your shapes you need to follow 3 conventions

1. Editor Template Name: <ShapeName>.InlineEdit.cshtml convention...

2. put your shape contents inside of

@using (Html.InlineEdit(this)) { 
   <Stuff goes here>
}

The using statement will wrap everything within a Form Post based on the shape and other stuff passed to it.

i.e. If I for example want to enable the shape Parts_Title to be inline editable you will need to create an editor template within your theme called

\Views\EditorTemplates\Parts.Title.InlineEdit.cshtml

With the contents

@using Orchard.ContentManagement
@using Orchard.Core.Title.Models
@using Orchard.InlineEditing
@{
    var titlePart = (TitlePart)Model.DisplayShape.ContentPart;
}

@using (Html.InlineEdit(this)) {
    <fieldset>
        <label for="Title_Title">@T("Title")</label>
        @Html.TextBox("Title", titlePart.Title, new { @class = "large text", autofocus = "autofocus" })
        <span class="hint">@T("You must provide a title for this content item")</span>
    </fieldset>
}


3. The shape now needs to be placed within your placement.info file

<Match DisplayType="Detail">
    <Place Parts_Title_InlineEdit="Inline:1" />
</Match>

For alot more examples please view my sample theme https://github.com/Jetski5822/orchard-forum-theme

Last edited Aug 9, 2013 at 10:07 AM by Jetski5822, version 3

Comments

No comments yet.