Dream Dede List Call the first picture of the Atlas the original address (not thumbnail) _dede

Source: Internet
Author: User

We often encounter a list page or a content page to call a picture instead of a thumbnail when using a Dede picture set, so what happens when you run into a problem like this? Today we're going to share a solution:

Step One:
Modify include/extend.func.php

Add the following code:

Take the first picture address
function firstimg ($str _pic)
{
$str _sub=substr ($str _pic,0,-7). " JPG//delete the last seven digits of the thumbnail string, and then the suffix. jpg
return $STR _sub;
}
Step Two: Write the call tag directly inside the Dede template

And then loop through the template:

Use in list: [Field:litpic function=firstimg (' @me ')/]
Use in content pages: {dede:field name= ' litpic ' function= ' firstimg (@me) '/}

The modification method has a disadvantage: the upload of the image must be JPG format, the dead format a bit of trouble.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.