PageAdmin网站内容管理系统(CMS)交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

请问一下怎么获文章的栏目名称? [复制链接]

1#
请问一下怎么获文章的栏目名称?
分享 转发
TOP
2#

回复 3楼真龙王的帖子

我想显示的是文章对应的栏目名称,不是seo标题。
TOP
3#

  1. @{
  2.     PageInfo pageInfo = new PageInfo()
  3.     {
  4.         PageSize =10,//每页显示10条数据
  5.         CurrentPage = (int)ViewBag.CurrentPage //当前页码,系统预设
  6.     };
  7. }
  8. <div class="container padding-top-20">
  9.     <div class="row">
  10.         <div class="col-md-3">
  11.             @Html.Partial("subNavPartial")
  12.         </div>
  13.         <div class="col-md-9">
  14.             @Html.Partial("BreadcrumbPartial")
  15.             @Html.Partial("SearchPartial")
  16.             <div class="news-list">
  17.                 <ul>
  18.                     @foreach (var item in Html.InfoDataList(new { ColumnId = Html.CurrentColumnId() }, null, null, pageInfo))
  19.                     {
  20.                         string url = Html.InfoDataUrl((int)item.ColumnId, (int)item.Id);
  21.                         string thumbnail = item.Thumbnail;
  22.                         string date = item.Thedate.ToString("yyyy-MM-dd");
  23.                         <li class="item">
  24.                             <span class="title">
  25.                                 <a href="@url" target="_self" title="@item.Title">@item.Title</a>
  26.                             </span>
  27.                             <span class="date">@date</span>
  28.                         </li>
  29.                     }
  30.                 </ul>
  31.             </div>
  32.             @Html.Partial("PagebreakPartial", pageInfo)
  33.         </div>
  34.     </div>
  35. </div>
复制代码
TOP
4#

和下面这个效果一样,标题前面加个栏目,点击栏目还可以跳转到对应栏目页面

TOP
发新话题 回复该主题