search
HomeCMS TutorialDEDECMSHow to realize that if there are thumbnails in the Dreamweaver list, the thumbnails will be displayed

How to realize that if there are thumbnails in the Dreamweaver list, the thumbnails will be displayed

How to display thumbnails in the Dreamweaver list if there are thumbnails?

If there is a thumbnail in the DEDECMS list, the thumbnail will be displayed. If there is no thumbnail, the image will not be displayed.

Recommended learning: 梦Weavercms

Many friends who use DEDECMS to build websites want to implement this function. Sometimes articles may not always be equipped with pictures, so they want to display thumbnails if there are thumbnails, and not display pictures if there are no thumbnails.

You can modify the implementation according to the following method, open the file (this is the default template)

Find the following code:

[field:array runphp=&#39;yes&#39;]@me = (emptyempty(@me[&#39;litpic&#39;]) ? "" : "<a class="preview" href="{@me["><img src="/static/imghwm/default1.png"  data-src="{@me["  class="lazy"   alt="" /></a>"); [/field:array]

Replace it with the following code:

[field:array runphp=&#39;yes&#39;]@me = (strpos(@me[&#39;litpic&#39;],&#39;defaultpic&#39;) ? "" : "<a href=&#39;{@me[&#39;arcurl&#39;]}&#39; class=&#39;preview&#39;><img  src=&#39;{@me[&#39;litpic&#39;]}&#39;/ alt="How to realize that if there are thumbnails in the Dreamweaver list, the thumbnails will be displayed" ></a>"); [/field:array]

Then regenerate the list page again.

The above is the detailed content of How to realize that if there are thumbnails in the Dreamweaver list, the thumbnails will be displayed. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function