如何将Orchard CMS Admin控件内联

Pet*_*ter 1 css admin orchardcms

我正在使用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"))
Run Code Online (Sandbox Code Playgroud)

这是它的样子:

果园管理员

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

mda*_*eer 5

您必须将forcheckbox类添加到单选框和复选框的标签中,或者要在行内显示的任何元素。

@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"))
Run Code Online (Sandbox Code Playgroud)