


How to determine the custom attributes of articles when DreamWeaver calls the article list
#How to determine the custom attributes of articles when Dreamweaver calls the article list?
Dreamweaver dedecms determines the article custom attributes when calling the article list
Recommended learning: Dreamweaver cms
Sometimes we need to pass Determine the attributes of the article to give corresponding styles to the corresponding attributes, such as adding recommended signs to recommended articles, etc.
For example, the following code can determine whether the article has two attributes: recommendation and picture, and output it in different styles:
[field:array runphp='yes'] if (@me['flag']=='c,p') @me='<em>推荐</em>'; else @me=''; [/field:array]
The above code can be embedded in the {dede:list} tag , a complete example is as follows:
{dede:list pagesize='10'} <li style="width:232px;"> [field:array runphp='yes'] if (@me['flag']=='c,p') @me='<em class=icotj><img src=/static/image/stamp/013.small.gif alt=推荐板 align=absmiddle /></em>'; elseif (@me['flag']=='h,p' || @me['flag']=='c,h,p') @me='<em class=icotj><img src=/static/image/stamp/012.small.gif alt=精华align=absmiddle /></em>'; else @me=''; [/field:array] <div class="c cl"> [field:array runphp='yes']@me = (empty(@me['litpic']) ? "" : "<a href='{@me['arcurl']}' title='[field:title/]' class='z'><img src='{@me['litpic']}'/ alt="How to determine the custom attributes of articles when DreamWeaver calls the article list" ></a>"); [/field:array] </div> <b class="xw0"> <a href="[field:arcurl/]" title="[field:title/]">[field:title/]</a> </b> </li> {/dede:list}
The above is the detailed content of How to determine the custom attributes of articles when DreamWeaver calls the article list. For more information, please follow other related articles on the PHP Chinese website!

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

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

Dreamweaver CS6
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
