Orchard Core 文档翻译 (六)HTML
Body (OrchardCore.Html)
Theming
Shapes
将HtmlBodyPart附加到内容类型时,将呈现以下形状(Shapes)
| Name | Display Type | Default Location | Model Type |
|---|---|---|---|
HtmlBodyPart |
Detail |
Content:5 |
HtmlBodyPartViewModel |
HtmlBodyPart |
Summary |
Content:10 |
HtmlBodyPartViewModel |
HtmlBodyPartViewModel
HtmlBodyPartViewModel类提供以下属性。
| Property | Type | Description |
|---|---|---|
Body |
string |
The content that was edited. It might contain tokens. |
Html |
string |
The HTML content once all tokens have been processed |
ContentItem |
ContentItem |
The content item of the part |
HtmlBodyPart |
HtmlBodyPart |
The HtmlBodyPartinstance |
TypePartSettings |
HtmlBodyPartSettings |
The settings of the part |
HtmlBodyPart
HtmlBodyPart上提供了以下属性
| Name | Type | Description |
|---|---|---|
Body |
string |
The HTML content in the body. It can contain Liquid tags so using it directly might result in unexpected results. Prefer rendering the HtmlBodyPart shape instead |
Content |
The raw content of the part | |
ContentItem |
The content item containing this part |
Editors
HtmlBody Part编辑器对于每种内容类型可以是不同的。 在内容类型的HtmlBody Part 设置中,只需选择需要使用的设置即可。
有两个预定义的编辑器名称:
Default是默认使用的编辑器- Wysiwyg是提供WYSIWYG体验的编辑器
Custom Editors
自定义编辑器可能意味着用不同的体验替换预定义的编辑器,或者为用户提供可供选择的新选项。
要创建新的自定义编辑器,需要提供两个形状模板( shape templates),一个用于提供编辑器的名称(如果要覆盖现有编辑器,则为可选),以及用于呈现编辑器的实际HTML格式。
Declaration
要声明新编辑器,请创建名为HtmlBody_Option__{Name}的格式,其中{Name}是您选择的值。 这将由一个名为的文件表示 HtmlBody-{Name}.Option.cshtml.
Sample content:
@{
string currentEditor = Model.Editor;
}
<option value="Wysiwyg" selected="@(currentEditor == "Wysiwyg")">@T["Wysiwyg editor"]</option>
HTML Editor
要定义从设置中选择编辑器时要呈现的HTML,可以创建与文件Body-{Name} .Editor.cshtml 对应的名为HtmlBody_Editor __ {Name}的格式。
Sample content:
@using OrchardCore.Html.ViewModels;
@model HtmlBodyPartViewModel <fieldset class="form-group">
<label asp-for="Body">@T["Body"]</label>
<textarea asp-for="Body" rows="5" class="form-control"></textarea>
<span class="hint">@T["The body of the content item."]</span>
</fieldset>
覆盖预定义的编辑器
您可以通过创建名为HtmlBody.Editor.cshtml的文件来覆盖默认编辑器的HTML编辑器。 Wysiwyg编辑器是使用名为HtmlBody-Wysiwyg.Editor.cshtml的文件定义的。
鸣谢
Trumbowyg
https://github.com/Alex-D/Trumbowyg
Copyright (c) 2012-2016 Alexandre Demode (Alex-D)
License: MIT
原文链接:https://www.cnblogs.com/Qbit/p/9746477.html
Orchard Core 文档翻译 (六)HTML的更多相关文章
- Orchard Core 文档翻译 (二)代码生成模板 Code Generation Templates
Code Generation Templates 翻译原文:https://www.cnblogs.com/Qbit/p/9746457.html转载请注明出处 Orchard Core Templ ...
- Orchard Core 文档翻译 (三) Orchard Core Modules
原文连接:https://www.cnblogs.com/Qbit/p/9746442.html 转载请注明出处 介绍 Orchard Core Modules库提供了一种机制,可以拥有一个独立的模块 ...
- Orchard官方文档翻译(六) 建立你的第一个Orchartd站点
让我们开始 该主题内容已在Orchard1.8Release版本下测试通过. 这里通过向导式的教程来告诉大家Orchard的功能如何使用.如果你是第一次使用Orchard,该文档就是为你而准备的! O ...
- Orchard Core 文档翻译 (七)Contents
CMS Modules »Contents Contents (OrchardCore.Contents) 此模块提供内容管理服务. Liquid 您可以使用“content ”属性从liquid 视 ...
- Orchard Core 文档翻译 (五)自动路由 Autoroute (OrchardCore.Autoroute)
Autoroute (OrchardCore.Autoroute) 此模块允许您为内容项指定自定义URL(永久链接 permalink). Autoroute Part 将此部分附加到内容类型以指定内 ...
- Orchard Core 文档翻译 (四)CMS ModulesTitle (OrchardCore.Title)
Title (OrchardCore.Title) 标题模块提供Title Part ,允许用户定义内容项的标题.它还定义了ContentItemMetadata方面的DisplayText属性 Th ...
- Orchard core 中文文档翻译系列
本系列翻译顺序完全参照 官方顺序 原文地址:https://orchardcore.readthedocs.io/en/latest/ Orchard Core 中文文档翻译(一)关于Orchard ...
- Orchard Core 中文文档翻译(一)关于Orchard Core
原文连接:https://www.cnblogs.com/Qbit/p/9746363.html 转载请注明出处 翻译说明:本系列为直译,按照官方的计划现在这个版本(2018年10月5日)已经接近最终 ...
- Orchard Core一分钟搭建ASP.NET Core CMS
Orchard Core 是Orchard CMS的ASP.NET Core版本. Orchard Core是全新一代的ASP.NET Core CMS. 官方文档介绍:http://orchardc ...
随机推荐
- POJ - 2018 二分+单调子段和
依然是学习分析方法的一道题 求一个长度为n的序列中的一个平均值最大且长度不小于L的子段,输出最大平均值 最值问题可二分,从而转变为判定性问题:是否存在长度大于等于L且平均值大于等于mid的字段和 每个 ...
- Collectors.groupingBy分组后的排序问题
默认groupingBy代码里会生成一个HashMap(hashMap是无序的,put的顺序与get的顺序不一致) HashMap是无序的,HashMap在put的时候是根据key的hashcode进 ...
- Android四层架构
Andrid系统的体系结构设计为多层结构,这种结构在给用户提供安全保护的同时还保持了开放平台的灵活性.如下图所示: Google官方提供的Android系统的四层架构图 从上到下进行简单介绍: 一 ...
- 基于原生态Hadoop2.6 HA集群环境的搭建
hadoop2.6 HA平台搭建 一.条件准备 软件条件: Ubuntu14.04 64位操作系统, jdk1.7 64位,Hadoop 2.6.0, zookeeper 3.4.6 硬件条件 ...
- (转) Linux Shell经典实例解析
原文:http://blog.csdn.net/yonggeit/article/details/72779955 该篇博客作为对之前Linux Shell常用技巧和高级技巧系列博客的总结,将以Ora ...
- 为什么一段时间后网站后台自动退出 php中session过期时间设置
修改php配置文件中的session.gc_maxlifetime.如果想了解更多session回收机制,继续阅读.(本文环境php5.2) 概述:每一次php请求,会有1/100的概率(默认值)触发 ...
- rsync的配置
1. 安装rsync,如果要讲1.1.1.1的数据备份到2.2.2.2上,则在1.1.1.1上配置如下: /etc/rsyncd.conf uid = nobody gid = nobody use ...
- jqGrid -treeGrid 按需加载
Load Rows On Demand (AJAX) 参考:http://www.guriddo.net/demo/treegridjs/
- 11、幻灯片:Slides
/* ---ts----*/ import { Page,Slides } from 'ionic-angular'; import { ViewChild } from '@angular/core ...
- C#委托的好处
C#委托的好处 先来看一个例子: 某人有三子,让他们各自带一样东西出门,并带回一头猎物. 可以理解为一种父亲对儿子的委托: 猎物 办法(工具 某工具) 三个人执行委托的方法各不相同 兔子 打猎(工具 ...