
在织梦模型里增加个字段,然后在添加文章的时候,在字段里填了栏目id进去
在前台的内容页,调用这个字段栏目的多个文章出来
{dede:field.field1 runphp=yes}global $dsql;$sql = "select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.moresite,tp.siteurl,tp.sitepathfrom `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id where tp.id in (@me) LIMIT 10";$dsql->SetQuery($sql);$dsql->Execute('t');$result = '';while($row = $dsql->GetArray('t')){$arcurl=GetOneArchive($row['id']);$pubdate = MyDate('Y-m-d H:i:s',$row['pubdate']);$result .= "<li><span>{$pubdate}</span><a href=/"{$arcurl['arcurl']}/">{$row['title']}</a></li>";}@me = $result;{/dede:field.field1}
field1 为字段名称
dedecms {dede:datalist}标签下,if语句的运用!{dede:
上面是“织梦文章添加字段填栏目id,内容页调用字段里的”的全面内容,想了解更多关于 织梦cms 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_538.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

一款免费高性能,无注册,媲美专业图像处理工具——AI Image Editor
zblog建站如何设置根目录的nginx伪静态和二级目录nginx伪静态
一个快速搭建属于自己的AI助手平台——RuoYi AI
Unlucid AI应用功能特点介绍及官方网址入口