DTcms.Web.UI\Label\category.cs中
添加下面代码
/// <summary> /// 返回所有类别 /// </summary> /// <returns></returns> protected DataTable get_category() { BLL.channel bll = new BLL.channel(); return bll.GetList(0, "", " sort_id desc").Tables[0]; }
模版调用:
<%set DataTable categorylist=get_category()%> <%loop category categorylist%> <a href="{category[name]}/{category[name]}_index.html">{category[title]}</a> <%/loop%>
链接地址看后台设置,灵活调用
时间: 2024-10-11 12:24:13