分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 软件开发

应用phpcms建立企业站替换总结

发布时间:2023-09-06 01:21责任编辑:傅花花关键词:暂无标签

首先是首页命名为index,在首页导航栏显示的一级栏目,点击一级栏目进入的是栏目首页,命名用category打头。点击一级栏目下的二级栏目进入的是栏目列表页,命名用lists打头。点击栏目列表页之中的内容进入的是内容页,命名用show来打头。二级栏目是建在一级栏目下的子栏目,而内容是建在二级栏目的文章中。

在替换时首页导航栏的替换:

{pc:content action="category" catid="0" num="4" siteid="$siteid" order="listorder ASC"}
???????{loop $data $r}
????????<div class="login-1"><a href="{$r[url]}" class=" xx xuanzhong">{$r[catname]}</a></div>
???????{/loop}
???????????{/pc}

content表示内容,category表示栏目,一级栏目调用catid取0,{$r[url]}表示连接到栏目首页,{$r[catname]}为栏目名,{$CATEGORYS[$catid][image]}为单独调用栏目图片

二级栏目的替换:

{pc:content action="category" catid="$top_parentid" num="5" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
<a href="{$r[url]}"><div class="liebiaoc-1">{$r[catname]}</div></a>
{/loop}
??{/pc}

$top_parentid为顶级栏目id,单独调用可以将具体栏目的catid写上,{$r[url]}连接到的是列表页

列表页的替换:

{pc:content action="lists" catid="$catid" num="3" siteid="$siteid" order="catid ASC" moreinfo="1"}
{loop $data $r}
???????????????????<div>
???<a href="{$r[url]}"><div style="float: left;width: 210px;height: 140px;"><img src="{$r[thumb]}" style="width: 210px;height: 140px;"/></div>
???<div style="float: left;height: 140px;width: 580px; margin-left: 20px;color: black;">
???<div style="font-size: 24px;padding-bottom: 10px;">{$r[title]}</div>
???{$r[description]}<br />
???<div style="margin-top: 10px;">{date("Y-m-d",$r[updatetime])}</div>
???</div>
???</div></a>
???<div style="clear: both;height:30px;"> </div>
{/loop}
{/pc}

lists表示调用文章,catid为文章所属栏目的catid,order表示排序, moreinfo="1"表示显示全部

{$r[url]}表示链接到内容页,{$r[thumb]}表示文章上传的图片,{$r[title]}表示文章的标题,{$r[description]}表示文章的摘要,{date("Y-m-d",$r[updatetime])}表示的修改时间,{$r[conent]}表示文章的内容。

单独调用:

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

{$CAT[catname]} 父级栏目名

应用phpcms建立企业站替换总结

原文地址:http://www.cnblogs.com/p774692352/p/7750128.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved