Skip to content

Commit

Permalink
Editing while reading (OrchardCMS#2587)
Browse files Browse the repository at this point in the history
  • Loading branch information
jean authored and sebastienros committed Oct 30, 2018
1 parent 0274cf3 commit 317d82c
Show file tree
Hide file tree
Showing 39 changed files with 501 additions and 509 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Orchard Core

Orchard Core is a re-implementation of [Orchard CMS](https://github.com/OrchardCMS/Orchard) in [ASP.NET Core](http://www.asp.net/vnext). You can check out the [Orchard Core presentation from the last Orchard Harvest](https://www.youtube.com/watch?v=TK6a_HfD0O8) to get an introductory overview of its features and goals.
[Orchard Core](https://github.com/OrchardCMS/OrchardCore) is a re-implementation of [Orchard CMS](https://github.com/OrchardCMS/Orchard) in [ASP.NET Core](http://www.asp.net/vnext). You can check out the [Orchard Core presentation from the last Orchard Harvest](https://www.youtube.com/watch?v=TK6a_HfD0O8) to get an introductory overview of its features and goals.

[![Join the chat at https://gitter.im/OrchardCMS/OrchardCore](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/OrchardCMS/OrchardCore?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![BSD-3-Clause License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](LICENSE.txt)
Expand All @@ -23,7 +23,7 @@ Nightly (dev):

## Orchard CMS

Orchard is a free, [open source](https://github.com/OrchardCMS/Orchard), community-focused Content Management System built on the ASP.NET MVC platform.
Orchard is a free, [open source](https://github.com/OrchardCMS/OrchardCore/blob/dev/LICENSE), community-focused Content Management System built on the ASP.NET MVC platform.

## Status

Expand Down Expand Up @@ -58,7 +58,7 @@ Docker images and parameters can be found at https://hub.docker.com/u/orchardpro

### Contributing

We currently follow the these [engineering guidelines](https://github.com/OrchardCMS/OrchardCore/wiki/Engineering-Guidelines).
We currently follow these [engineering guidelines](https://github.com/OrchardCMS/OrchardCore/wiki/Engineering-Guidelines).

### Documentation

Expand Down
6 changes: 3 additions & 3 deletions src/OrchardCore.Modules/OrchardCore.Alias/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Alias (OrchardCore.Alias)
# Alias (`OrchardCore.Alias`)

This module allows you to specify friendly identifiers for your content items.
Aliases can also be imported and exported, which means that they are persisted when running recipes or deploying content (whereas content item IDs are not).
Expand All @@ -11,13 +11,13 @@ Attach this part to a content type to specify aliases for your content items.

With Alias enabled, you can retrieve content by alias in your liquid views and templates:

```
```liquid
{% assign my_content = Content["alias:footer-widget"] %}
```

or

```
```liquid
{% assign my_content = Content.Alias["footer-widget"] %}
```

16 changes: 8 additions & 8 deletions src/OrchardCore.Modules/OrchardCore.Autoroute/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Autoroute (OrchardCore.Autoroute)
# Autoroute (`OrchardCore.Autoroute`)

This module allows you to specify custom URLs (permalink) for your content items.
This module allows you to specify custom URLs (permalinks) for your content items.

## Autoroute Part

Expand All @@ -10,28 +10,28 @@ Then, go to the definition of a Content Type and edit the Autoroute Part:

- Enter a Pattern using a Liquid expression that will represent the generated slug.

Example for a content with a TitlePart that will use it to generate the slug :
For example, for a content with a `TitlePart` that will use it to generate the slug :

```liquid
{{ ContentItem | display_text | slugify }}
```

Example for a content with a ListPart and a TitlePart (ig: BlogPost nested in a Blog) that will use the container and the title to generate the slug:
For example, for a content type with a `ListPart` and a `TitlePart` (e.g.: `BlogPost` nested in a `Blog`) that will use the container and the title to generate the slug:

```liquid
{{ ContentItem | container | display_text | slugify }}/{{ ContentItem | display_text | slugify }}`
{{ ContentItem | container | display_text | slugify }}/{{ ContentItem | display_text | slugify }}
```

- If you want to be able to enter a custom path when you edit a content item, check 'Allow custom path'.
- If you want to be able to set a content item as the homepage, check 'Show homepage options'
- If you want to be able to set a content item as the homepage, check 'Show homepage options'.

## Autoroute Alias

Content items with an Autoroute can be retrieved by URL anywhere you can retrieve content by alias (see example below). The syntax for this is `slug:<URL>`, e.g. `slug:my-blog/my-blog-post`.
Content items with an `Autoroute` can be retrieved by URL anywhere you can retrieve content by alias (see example below). The syntax for this is `slug:<URL>`, e.g. `slug:my-blog/my-blog-post`.

## Liquid

With Autoroute enabled, you can retrieve content by URL in your liquid views and templates:
With `Autoroute` enabled, you can retrieve content by URL in your liquid views and templates:

```liquid
{% assign my_content = Content["slug:my-blog/my-blog-post"] %}
Expand Down
17 changes: 8 additions & 9 deletions src/OrchardCore.Modules/OrchardCore.ContentFields/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Content Fields (OrchardCore.ContentFields)
# Content Fields (`OrchardCore.ContentFields`)

## Purpose

Expand Down Expand Up @@ -44,13 +44,13 @@ The convention for a field view model is to also expose these properties:

Some view models have special properties that are computed from the actual field data and which are more useful for templating.

### DisplayHtmlFieldViewModel
### `DisplayHtmlFieldViewModel`

| Property | Description |
| --- | --- |
| `Html` | The processed Html once all liquid tags are processed. |
| `Html` | The processed HTML, once all liquid tags have been processed. |

#### HtmlField Example
#### `HtmlField` Example

```liquid
{{ Model.Html }}
Expand All @@ -62,13 +62,13 @@ or, to display the raw content before the tags are converted:
{{ Model.Field.Html }}
```

### DisplayDateTimeFieldViewModel
### `DisplayDateTimeFieldViewModel`

| Property | Description |
| --- | --- |
| `LocalDateTime` | The date time in the time zone of the site. |

#### DateTimeField Example
#### `DateTimeField` example

```liquid
{{ Model.LocalDateTime }}
Expand All @@ -84,14 +84,14 @@ or, to display the UTC value before is it converted:

### What to extend

Before creating a new field the solution might be to provide a custom editor and formatter
Before creating a new field, the solution might be to provide a custom editor and formatter
instead.

A field should represent some specific physical data and logical data. The same field can be customized
to be edited and rendered differently using both Editors and Formatters. Editors are shapes that can
be used to edit a field differently, for instance the WYSIWYG HTML editor is a custom editor for the HTML
field. Formatters are alternate shapes that can be used to render a field on the front end, for instance
a Link field could be rendered as a Youtube video player.
a `Link` field could be rendered as a Youtube video player.

### Model Class

Expand All @@ -106,7 +106,6 @@ public class TextField : ContentField
{
public string Text { get; set; }
}

```

This class needs to be registered in the DI like this:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Content Preview (OrchardCore.ContentPreview)

Content preview allows you to display the result that will be rendered on the front in a separate window while you are editing a content in the admin.
Content preview allows you to display the result that will be rendered on the frontend in a separate window, while you are editing a content item in the admin.

A `Preview` button is available in the action buttons when you create or edit a content item.

Expand Down
11 changes: 5 additions & 6 deletions src/OrchardCore.Modules/OrchardCore.ContentTypes/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Content Types (OrchardCore.ContentTypes)
# Content Types (`OrchardCore.ContentTypes`)

## View Components

### SelectContentTypes
### `SelectContentTypes`

Renders an editor to select a list of content types.
It can optionally filter content types of a specific stereotype.
Expand All @@ -14,20 +14,19 @@ The editor returns the selection as a `string[]` on the model.
| --------- | ---- | ----------- |
| `selectedContentTypes` | `string[]` | The list of content types that should be marked as selected when rendering the editor. |
| `htmlName` | `string` | The name of the model property to bind the result to.
| `stereotype` (optional) | `string` | A stereotype name to filter the list of content types to be able to select. |
| `stereotype` (optional) | `string` | A stereotype name to filter the list of content types available to select. |

#### Sample

```csharp
@await Component.InvokeAsync("SelectContentTypes", new { selectedContentTypes = Model.ContainedContentTypes, htmlName = Html.NameFor(m => m.ContainedContentTypes) })

```

## Migrations

Migration classes can be used to alter the content type definitions, like by adding new __types__, or configuring their __parts__ and __fields__.

### IContentDefinitionManager
### `IContentDefinitionManager`

This service provides a way to modify the content type definitions. From a migrations class, we can inject an instance of this interface.

Expand Down Expand Up @@ -103,7 +102,7 @@ For a list of all the settings each type can use, please refer to their respecti

### Adding Content Fields to a part

Fields can not be attached directly to a Content Type. To add fields to a content type, create a part using with the same name as the type and add fields to this part.
Fields can not be attached directly to a Content Type. To add fields to a content type, create a part with the same name as the type, and add fields to this part.

```csharp
_contentDefinitionManager.AlterTypeDefinition("Product", type => type
Expand Down
17 changes: 9 additions & 8 deletions src/OrchardCore.Modules/OrchardCore.Contents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ This module provides Content Management services.
## Liquid

You can access content items from liquid views and templates by using the `Content` property.
By default, you can retrieve content by alias or content item ID. Other modules (such as Alias and Autoroute) allow you to retrieve content by other identifiers.
By default, you can retrieve content by alias or content item ID.
Other modules (such as `Alias` and `Autoroute`) allow you to retrieve content by other identifiers.

#### Loading from an alias

```
```liquid
{% assign my_content = Content["alias:main-menu"] %}
```

Aliases can be in various forms, like when using Autoroute, with the `slug` prefix.

```
```liquid
{% assign my_content = Content["slug:my-blog/my-blog-post"] %}
```

Expand All @@ -25,25 +26,25 @@ Aliases can be in various forms, like when using Autoroute, with the `slug` pref

You can use the `Latest` property to retrieve the latest version of a content item (whether that's the published version or the latest draft version) by alias:

```
```liquid
{% assign my_content = Content.Latest["alias:main-menu"] %}
```

#### Loading from a content item id

```
```liquid
{% assign my_content = Content.ContentItemId["417qsjrgv97e74wvp149h4da53"] %}
```

When a list of content item ids is available, the `content_item_id` filter should be preferred:

```
```liquid
{% assign posts = postIds | content_item_id %}
```

#### Loading from a content item version id

```
```liquid
{% assign my_content = Content.ContentItemVersionId["49gq8g6zndfc736x0az3zsp4w3"] %}
```

Expand All @@ -60,4 +61,4 @@ The following methods are available from the Razor helper.
| `GetContentItemByVersionIdAsync` | `string contentItemVersionId` | Loads a content item from its version id. |


> The Razor Helper is accessible on the `Orchard` property if the view is using Orchard Core's Razor base class, or by injecting `OrchardCore.IOrchardHelper` in all other cases.
> The Razor Helper is accessible on the `Orchard` property if the view is using Orchard Core's Razor base class, or by injecting `OrchardCore.IOrchardHelper` in all other cases.
4 changes: 2 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.CustomSettings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Once created, open the Setting menu item and each of these sections should appea

Each Custom Settings sections gets a dedicated permission to allow specific users to edit them.

To edit this permission open the Roles editor and go to the OrchardCore.CustomSettings Feature group.
To edit this permission open the Roles editor and go to the `OrchardCore.CustomSettings` Feature group.

### Templates

The Custom Settings like other settings are available in the `{{ Site.Properties }}` object.
The Custom Settings (like other settings) are available in the `{{ Site.Properties }}` object.
Each section is made available using its name.

For instance the `HtmlBodyPart` of a custom settings section named `BlogSettings` would be accessible using `{{ Site.Properties.BlogSettings.HtmlBodyPart }}`.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You'll need to specify a storage account connection string and a valid container

These settings need to be available to the `IConfiguration` implementation. In the simplest case, this will mean updating your `appsettings.json` file:

```
```json
{
"Modules": {
"OrchardCore.DataProtection.Azure": {
Expand Down
Loading

0 comments on commit 317d82c

Please sign in to comment.