布局中的Orchard CMS @IF语句

时间:2014-09-08 16:02:21

标签: razor content-management-system orchardcms

如果是@IF语句,请知道如何更改Orchard CMS中的布局。

基本上在主页上我需要一个额外的,所以我需要如果主页{(然后这样做)}否则{do that}

@if (Request.Url.ToString ().Equals("http://localhost:5603/"))
{
<h1>Shows on HomePage</h1>
             }
else
{
<h1>Sows on Everything Else</h1>   
}

编辑:

它很脏,但对我有用

@if (Request.Url.ToString().EndsWith("/"))
{
<h1>Shows on HomePage</h1>
}
else
{
<h1>Sows on Everything Else</h1>   
}

1 个答案:

答案 0 :(得分:1)

了解图层和窗口小部件的工作方式,您可以根据规则(例如:url =〜/)将所有信息放在所需的位置: http://docs.orchardproject.net/Documentation/Managing-widgets

相关问题