基于页面的布局 - OrchardCMS

标签 layout orchardcms styling

我在使用 Orchard 时遇到了一个问题,我确信应该有一个相当简单的修复/解决方案,但我还没有找到它。

我正在尝试为我的主页(580px)建立一个特定宽度的内容区域,并为内容页面(800px)建立一个更大的宽度。

Layout.cshtml 片段:

    <div id='content'>
        @Zone(Model.Content)
    </div>

风格:
    #Content
    {
        [...]
        width: 580px;
    }

目前 - 无论页面(主页或内容)如何,内容 div 都包含我的所有内容。我想知道是否可以使用不同的 div 来包装基于 Page 的内容,如图所示:

Layout.cshtml 想法:
@if(Model.Page != "Home")
{
    <div id='fullcontent'>
        @Zone(Model.Content)
    </div>
}
else
{
    <div id='content'>
        @Zone(Model.Content)
    </div>
}

我不确定上述建议的方法是否可行(或者我不确定如何检查当前页面) - 但任何其他建议将不胜感激。

最佳答案

您可以使用 Designer Tools 模块(内置所有最新的 Orchard 版本)并启用 URL 替代功能。然后,您将能够为您的布局创建一个 layout-url-homepage.cshtml 替代。

关于基于页面的布局 - OrchardCMS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6791421/

相关文章:

dynamic - Orchard 模块 - 如何从驱动程序返回强类型模型而不是动态模型

orchardcms - 如何管理 Orchard 主题中的区域?

javascript - react / react Hook : I'm trying to dynamically change the style of an input with a conditional function that triggers when a user leaves an input

angularjs - Angular6 ngStyle 动态应用样式

css - eclipse e4 深色主题 : How to style widgets created by FormToolKit with css

qt - 扩展 Qt 布局 : how to put a widget on the right side and the let the other widget to fully fill the left?

html - 居中布局,一侧有背景图案 - 另一侧为纯色

css - 如何在 Orchard 模块中包含一个 css 样式表?

android - 在不重新创建 View 的情况下在运行时更改 fragment 中的方向时更改布局

layout - 使用 Gridstack 或 gridster 进行小部件布局?