默认phpcms是无法使用推荐位调用自定义字段的,直接写{pc:content action="position" posid="30" catid="24" order="listorder DESC" num="4"}的话不会出错,但就是无法调用数据,显示的是空白。
调用代码
01.{pc:content action="position" posid="30" catid="24" order="listorder DESC" num="4"} 02.{loop $data $n $r} 03.{$r["kk_date"]} 04.{/loop} 05.{/pc} 代码说明
action="position" 内容推荐位列表
posid="30"调用推荐位ID为30下的内容
catid="24"调用栏目ID为24下的内容
order="listorder DESC"排序就不说了
num="4"显示四条内容
完成以上代码之后,一般来说还是无法显示的,phpcms后台模型管理中的字段还是需要做一些设置。
phpcms模型设置
第1步:成功登录到phpcms后台。
第2步:打开内容>>内容相关设置>>模型管理>>找到自己相对应的模型。
第3步:打开模型找到并打开“字段管理”,在自己需要显示的字段上点击“修改”。
第4步:在最后倒数第三个”在推荐位标签中调用“上选择是并确定保存。
第5步:然后在自己需要正常显示的文章上再次点击修改,再保存即可生效(什么不改都行就修改保存)。
第6步:更新网站缓存即可生效。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)
