Home > CMS Tutorial > DEDECMS > How 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

藏色散人
Release: 2020-01-03 09:11:03
Original
1769 people have browsed it

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="{@me[" alt="" /></a>"); [/field:array]
Copy after login

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;/></a>"); [/field:array]
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template