Home  >  Article  >  Backend Development  >  phpcms推荐位无法调用自定义字段_PHP教程

phpcms推荐位无法调用自定义字段_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:34:14794browse

   默认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步:更新网站缓存即可生效。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/752070.htmlTechArticle默认phpcms是无法使用推荐位调用自定义字段的,直接写{pc:content action=position posid=30 catid=24 order=listorder DESC num=4}的话不会出错,但就是无法调...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn