DEDECMS home to implement a custom small icon list

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

8630.html "> Sometimes for the website beautification and user experience degree, stationmaster will add some pictures in the page, this makes the website appear to have spirituality." Here next Dedecms uses the custom field to implement the homepage custom small icon The method.

I. Goal: Realize Dede homepage Call custom Small icon Document list

The effect chart is as follows:

  

Ii. Operation Steps

Login Dede backstage, into the "core", select "channel Model Management" of "content Model Management", select a model modification, here we choose

Software model, click Modify,

The following figure:

  

Third, add custom fields

Go to the Modify page, select field Management, and add the new field next.

The field parameters are as follows:

Form hint text is: Home list small icon (can be set to any name, this is only the background to add article when prompted.) )

Field Name: indeximg

Field type: The system automatically generates form fields

Foreground parameters: Not selected

Content pagination: No

Data type: Picture (URL only)

The default value is: null

Maximum Length: Default 250

Custom form HTML: Empty

Click OK, add a custom field, this time into the software channel, add software, you will find one more property box. This is the first

The selection box for the page custom small icon.

Four, the first page call code

The calling code is as follows:

       {dede:arclist flag= ' a ' addfields= ' indeximg ' titlelen=42 channelid=3 ' 6 ' row=}<li ' Indexline ' ><a href= "   [field:arcurl/]" class= "Indextitle" > [field:array runphp= ' yes '] @me = (empty (@me [' indeximg '])? "<img src=" http://www.badubox.com/images/indeximg.png "width=38 height=38>": "<img src= ' {@me [' indeximg ']} ' /width=38 height=38> "); [/field:array]<strong>[field:title/]</strong></a></li>{/dede:arclist}                  NOTE: In the red section above, for pictures you want to return when you don't specify a custom small icon, change to a picture of your own site.            v. Code Analysis           {dede:arclist Flag= ' A ' addfields= ' indeximg ' titlelen=42 channelid=3 row= ' 6 '} addfields= ' indeximg ' load pair words       The indeximg index of the segment so that the following [Field:array runphp= ' yes '] @me = (Empty (@me [' indeximg '])? "Gets the value of the Indeximg field.            @me = (Empty (@me [' indeximg '])? Determine if the field is empty                    If the custom field indeximg is empty, then return:         < IMG src= "http://www.***.com/images/indeximg.png"   width=38 height=38> "          Note: Here you need to set the default picture for yourself.           If the custom field indeximg is not empty, it returns:        <img src= ' {@me [' indeximg ']} '/WI Dth=38 height=38> is the value of the Indeximg field           design by www.badubox.com Eight-degree box Game Network   reprint please specify!

 

Related Article

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.