请教如何调用其他栏目名称

请教如何调用其他栏目名称,第1张

手动做导航就没有什么意思了,因为栏目名称可能随时改,会很不方便;至于用标签调,因为对帝国不是很了解,现在知道能用做栏目的好像只有[showclasstemp],但是这个标签在站点首页用时是没有问题的,可以调用所有顶级栏目,可是在任何一个顶级栏目中是不是能调用其它七个顶级栏目名称的。我试过把顶级栏目用静态页,这个[showclasstemp]的确起做用了,可以显示其它七个顶级栏目的名称,但是链接路径却还是动态的。不知道这是不是帝国的BUG。 查看原帖>>

phpcms常用标签

guml

php开发

顶级栏目名称:{$CATEGORYS[$top_parentid][catname]}

顶级栏目url:{$CATEGORYS[$top_parentid][url]}

顶级栏目id:{$CATEGORYS[$top_parentid][catid]}

其他字段只需要改动xxx:{$CATEGORYS[$top_parentid][xxx]}

父栏目名称:{$CATEGORYS[$CAT[parentid]][catname]}

父栏目url:{$CATEGORYS[$CAT[parentid]][url]}

父栏目id:{$CATEGORYS[$CAT[parentid]][catid]}

其他字段只需要改动xxx:{$CATEGORYS[$CAT[parentid]][xxx]}

内容页:

{$CAT[catid]}//调用上一级 栏目id

{$CAT[catname]}//调用上一级 栏目名称

{$CAT[url]}//调用上一级 栏目url

{go($catid,$id)} 获取当前页面链接 {$url}在静态时不正常

{$CATEGORYS[$catid][url]} 显示当前栏目链接

{$CATEGORYS[$catid][catname]} 显示当前栏目名称

{$CATEGORYS[$r[catid]][catname]}循环内显示栏目

{if $r[thumb]}<img src="{thumb($r[thumb],120,90)}"

alt="{$r[title]}" width="120" height="90" />{/if}有图显示图 没图不显示

截取:{str_cut($r[title],46,'')}

{str_cut(strip_tags($r[content]),400)} 列表页调取内容 过滤html标签 需要加moreinfo="1"

{date('Y-m-d H:i:s', $r['inputtime'])} 列表页调取发布时间

{date('Y-m-d',strtotime($inputtime))} 或者 {date('Y-m-d',time($inputtime))} 内容页调取发布时间

phpcms 调用当前栏目下的子栏目

categoryhtml 写以下代码:

{loop subcat($catid) $r}

<ul>

<li><a href="{$r[url]}" title="{$r[catname]}">{$r[catname]}</a></li>

</ul>

{/loop}

listhtml 写以下代码:

{loop subcat($catid) $r}

<ul>

<li><a href="{$CATEGORYS[$r[catid]][url]}">{$CATEGORYS[$r[catid]][catname]}</a></li>

</ul>

{/loop}

<div class="pindaoright" {if $r[thumb]==""} style="width:100%;" {/if}>

如果不存在 则执行某某

{if $r['catid']==$catid} class="newclass" {/if} 导航栏当前栏目增加class

phpcms分页代码

<style type="text/css">

text-c {margin:10px 0;}

text-c a {padding:5px;margin:0 8px;border:1px solid #ccc;background-color:#eee;}

</style>

<center><div id="pages" class="text-c">{$pages}</div></center>

phpcms v9列表页默认分页页码为10页,下面为分页页码条数的修改方法:

打开phpcms\libs\functions\globalfuncphp文件,

找到function pages函数(在672行左右)

修改下面代码中红色数字(10)为你想要显示的页码条数即可。

function pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array(),$setpages =10)

---------------------

手机端自适应大小和居中 文章缩进

<style type="text/css">

part img {

width:100%!important;

height: auto!important;

display: table-cell!important;

}

part p {

text-indent: 2em;

}

</style>

-------------------------------------

第一个是图 剩下的是列表

{pc:content action="lists" catid="7" order="listorder DESC" thumb="1" num="1"}

{php $imgarr=array();$count=0;}

{loop $data $r}

{php array_push($imgarr,$r[id]);}

<h4>

<a href="{$r[url]}" target="_blank" title="{$r[title]}">{str_cut($r[title],60,'')}</a>

</h4>

<a href="{$r[url]}" target="_blank" title="{$r[title]}">

<img src="{thumb($r[thumb],100,70)}" width="100" height="70" alt="{$r[title]}">

</a>

<p>{str_cut($r[description],90)}</p>

{/loop}

{/pc}

</div>

<ul>

{pc:content action="lists" catid="7" order="listorder DESC" num="5"}

{loop $data $r}

{if $count<4&&!in_array($r[id],$imgarr)}

{php $count++;}

<li><a href="{$r[url]}" target="_blank" title="{$r[title]}">{str_cut($r[title],57,'')}</a></li>

{/if}

{/loop}

{/pc}

phpcms调用sql实例

{pc:get sql="select from v9_news where catid=$catid and id!=$id order by updatetime desc" num="10"}

{loop $data $r}

<li>

<a target="_blank" href="{$r[url]}" style="color:#333333;">{$r[title]}</a>

<span style="margin-left: 30px;color: #666;font-size: 14px;">{date('Y-m-d', $r[updatetime])}</span>

</li>

{/loop}

{/pc}

{pc:get sql="SELECT FROM `v9_news` WHERE thumb!='$thumb' Order by id DESC " num="50"} 调用有的最新新闻

{loop $data $r}

织梦调用sql实例

{dede:sql sql="select from dede_archives where typeid=5 and id!=~id~"}

<li>

<a href="[field:id function=IDReturnURL(@me)/]" class="step-link">[field:title/]</a>

</li>

{/dede:sql}

指定栏目--{dede:type typeid='350'}<a href="[field:typelink /]">[field:typename /]</a>{/dede:type}

以上就是关于请教如何调用其他栏目名称全部的内容,包括:请教如何调用其他栏目名称、phpcms文章描述标签什么、织梦如何在arclist中调用顶级栏目的名称和链接等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/9570029.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-29
下一篇 2023-04-29

发表评论

登录后才能评论

评论列表(0条)

保存