PHPCMS V9除了可以使用系统自带字段之外还可以使用用户自定义的字段了,在这里我们要介绍的是调用自定义字段多图的例子.
- <!--调用组图类型字段成列表-->
- {pc:content action="lists" catid="$catid" num="10" order="listorder DESC" moreinfo="1" page="$page"}
- {loop $data $n $r}
- <div class="col-auto">
- {loop string2array($r['jietu']) $pic_k $v}
- <a href="{$v[url]}"><img src="{thumb($v[url],80,150)}" alt="{$v[alt]}"/></a>
- {/loop}
- </div>
- {/loop}
- {/pc}
- <!--单个调用关键字列表-->
- {pc:content action="lists" catid="$catid" num="10" order="id DESC" page="$page"}
- {loop $data $r}
- {php $keywords = explode(' ',$r[keywords]);}
- <b>关键字:</b>
- {loop $keywords $keyword}
- <a style="border:1px solid #3300FF; padding:2px;" href="{APP_PATH}index.php?m=content&c=tag&catid={$catid}&tag={urlencode($keyword)}"> {$keyword}</a>
- {/loop}
- {/loop}
- <!--调用box类型-->
- {pc:content action="lists" catid="$catid" num="10" order="id DESC" moreinfo="1" page="$page"}
- {loop $data $r}
- {php $lists = explode(',',$r[rom]);}
- <b>标签:</b>
- {loop $lists $rom}
- <a style="border:1px solid #3300FF; padding:2px;" href="#"> {$rom}</a>
- {/loop}
- {/loop}
以下为用于内容页:
- <!--调用组图类型字段成列表-->
- {loop $watermark $pic_k $r}
- <li><a href="{$r[url]}" target="_blank"><img src="{thumb($r[url])}" alt="{$r[alt]}" rel="{$r[url]}"/></a></li>
- {/loop}
- <!--单个调用关键字列表-->
- {loop $keywords $keyword}
- <li><a href="{APP_PATH}index.php?m=content&c=tag&catid={$catid}&tag={urlencode($keyword)}" class="blue">{$keyword}</a></li>
- {/loop}
- <!--调用box类型字段成列表-->
- {php $r = explode(',',$rom);}
- {loop $rom $rom}
- <li>{$rom}</li>
- {/loop}