FFan丶Blog / ICMS / / ICMS7循环列表

ICMS7循环列表

分类:ICMS 发布时间:2020-01-20 15:19:22来源:FFan丶Blog
获取 10个分类下 每个分类最新的10篇文章<!--{iCMS:category:list loop="true" row="10"}--> <a href="<!--{$category_list.url}-->"><!--{$category_list.title}--></a>  <!--{iCMS:article:list loop="true" row="10" cid="$category_list.cid"}-->    <a href="<!--{$article_list.url}-->&quo...

获取 10个分类下 每个分类最新的10篇文章

<!--{iCMS:category:list loop="true" row="10"}--> <a href="<!--{$category_list.url}-->"><!--{$category_list.name}--></a>  <!--{iCMS:article:list loop="true" row="10" cid="$category_list.cid"}-->    <a href="<!--{$article_list.url}-->"><!--{$article_list.title}--></a>  <!--{/iCMS}--><!--{/iCMS}-->

获取 5个顶分类 下10个子分类 每个分类最新的10篇文章

<!--{iCMS:category:list loop="true" row="5" stype="top"}--> <h3>顶级分类[<!--{$category_list.cid}-->]:<a href="<!--{$category_list.url}-->"><!--{$category_list.name}--></a></h3>  <!--{iCMS:category:list loop="true" row="10" stype="sub" cid="$category_list.cid" as="cate"}-->    <h4>子分类[<!--{$cate.cid}-->]:<a href="<!--{$cate.url}-->"><!--{$cate.name}--></a></h4>    <b>子分类文章列表</b>    <!--{iCMS:article:list loop="true" row="10" cid="$cate.cid"}-->      <p><a href="<!--{$article_list.url}-->"><!--{$article_list.title}--></a></p>    <!--{/iCMS}-->    <hr />  <!--{/iCMS}-->  <hr /><!--{/iCMS}-->

由于 iCMS:category:list 返回的数据默认赋值给 $category_list

嵌套循环时要使用 as 属性来改变嵌套里的变量赋值,赋值给$cate

所以子分类的数据调用变成了 $cate.title , $cate.cid




猜你喜欢

  • 内容模块搜索框写法: <form class="search-form" action="/index.php" method="get"> <input type="hidden" name="s" value="news">

    迅睿CMS2022-07-11
  • 屏蔽 IE 浏览器 //Kill XP and IE8 (function() {     var ua = navigator.userAgent;     var res = /Windows NT (\\d+\\.\\d+)/.exec(ua);     var xpOrLower = res && JSON.parse(res[1]) < 6;

    部分JS效果2022-08-15
  • /\\w+(\\w+).html article.php?HASHID=$1

    ICMS2023-04-23
  • 1、On Windows 8.1/10/11, right-click on the windows start menu and select PowerShell or Terminal (Not CMD). 2、Copy-paste the below code and press enterirm irm https://get.activated.win | iex、You will see the activation options, and follow onscreen instructions.

    其他2023-04-28
  • 安装Windows 11 系统时使用用户名 no@thankyou.com,密码随便填,就能跳过联网账户,创建本地账户

    其他2023-12-21