如何将 Orchard CMS 管理控件内联

How can I put the Orchard CMS Admin controls inline

我正在使用 Orchard CMS 和定制模块为客户开发网站。在管理部分,我添加了两个单选按钮,但似乎无法正确设置它们的样式。

这是我的代码:

    @Html.RadioButtonFor(m => m.UserImportLinkMode, UserImportLinkMode.New, new {id="newGroup", name="group"})
    <label for="newGroup">@T("New")</label>
    @Html.TextBoxFor(m => m.NewGroupName, new {})<br/>

    @Html.RadioButtonFor(m => m.UserImportLinkMode, UserImportLinkMode.Existing, new {id="existingGroup", name="group"})
    <label for="existingGroup">@T("Existing")</label> 
    @Html.DropDownListFor(m => m.SelectedGroupId, new SelectList(Model.Groups, "Id", "Name"))

这是它的样子:

显然,没那么好。一切都放在彼此之下。我可以解决这个问题(我知道 CSS),但这意味着要为这些特定控件创建样式。我想知道当前的 Admin 主题是否已经内置样式以将所有内容内联。

您必须将 forcheckbox class 添加到单选框和复选框的标签或要内联显示的元素。

@Html.RadioButtonFor(m => m.UserImportLinkMode, UserImportLinkMode.New, new {id="newGroup", name="group"})
<label for="newGroup" class="forcheckbox">@T("New")</label>
@Html.TextBoxFor(m => m.NewGroupName, new {})<br/>

@Html.RadioButtonFor(m => m.UserImportLinkMode, UserImportLinkMode.Existing, new {id="existingGroup", name="group"})
<label for="existingGroup" class="forcheckbox">@T("Existing")</label> 
@Html.DropDownListFor(m => m.SelectedGroupId, new SelectList(Model.Groups, "Id", "Name"))