PYROCMS在页面主体中显示自定义图像字段

时间:2014-06-30 14:26:53

标签: php codeigniter pyrocms

Body Editor中的

pyrocms页面如何编码显示自定义字段数据。像

我有一个图像自定义字段。我写的代码就像。

  

{{image:id}}

     

{{page:image:id}}

     

{{pages:image:id}}

     

{{template:image:id}}

{{ custom_fields }} 
     <img alt="" class="img-custom-responsive img-border" data-pyroimage="true" src="{{ url:site }}files/thumb/{{ image:id }}/310/310/fit" /> 
{{ /custom_fields }}

我在正文编辑器中编写此代码但这不是返回图片ID。

如何在body编辑器上获取图片ID。

请帮忙。

谢谢。

1 个答案:

答案 0 :(得分:0)

没有&#34; id&#34;图像字段类型的属性。 查看the docs on the image field-type以查看可用的属性。

示例:

{{ custom_fields }}{{ image:img }}{{ /custom_fields }} // produces a full img tag

{{ custom_fields }}{{ image:filename }}{{ /custom_fields }} // get the filename