如题,以下为信息表栏目代码。
@{
int columnId = Html.CurrentColumnId();//当前栏目id
PageInfo pageInfo = new PageInfo()
{
PageSize = 12,//每页显示12条数据
CurrentPage = (int)ViewBag.CurrentPage //当前页码,系统预设
};
var columnContentData = Html.ColumnContentData(columnId);
string templateDirectory = ViewBag.TemplateDirectory;
string zdytitle = columnContentData.Zdytitle;
var dataList = Html.InfoDataList(new { ColumnId = columnId, OrderBy = "thedate desc",ShowSubColumnData=1 }, null, null, pageInfo);
int number = 0;
}
<div class="webcontent">
<div class="container">
<div class="row">
<div class="web_navs1 col-xs-12 col-sm-3">
@Html.Partial("subNavPartial")
</div>
<div class="col-xs-12 col-sm-9">
<div class="row">
@{ foreach (dynamic item in dataList)
{
string url =Html.InfoDataUrl((object)item,false,false);//获取内容页地址
string thumbnail = item.Thumbnail;
string date1 = item.Thedate.ToString("dd");
string date = item.Thedate.ToString("yyyy/MM");
string date2 = item.Thedate.ToString("yyyy/MM/dd");
string introduction = item.Introduction;
number++;
if (number <= 1)
{
<div class="jy_news_mxlist row">
<div class="col-xs-12 col-sm-5 pics">
<a href="@url"> <img src="@thumbnail" alt="@item.Title"/></a>
</div>
<div class="col-xs-12 col-sm-7 coms">
<div class="dates">@date2</div>
<a href="@url" class="titles">@item.Title</a>
</div>
</div>
}
else
{
<div class="jy_news_mxlists row">
<div class="col-xs-12 col-sm-8 coms">
<a href="@url" class="titles">@item.Title</a>
<div class="times"><span class="s1">@date1</span><span class="s2">@date</span></div>
<div class="times2">@date2</div>
<div class="jianjie">@item.Introduction</div>
</div>
<div class="col-xs-12 col-sm-4 pics">
<a href="@url"><img src="@thumbnail" alt="@item.Title" /></a>
</div>
</div>
}
}
}
</div>
</div>
</div>
@Html.Partial("PagebreakPartial", pageInfo)
</div>
</div>