Dedecms homepage to customize the small icon list

Source: Internet
Author: User

 

Sometimes for the sake of website beautification and user experience, webmasters will add some pictures on the page, so that the website looks spiritual. Here, dedecms uses custom fields to implement the method of customizing small icons on the homepage.

  I. Goal: to implement the dede homepage call custom small icon document list

As follows:

  

 

 Ii. Procedure

Log on to the dede background, go to "core", select "content model management" under "channel model management", and select a model change. Here we choose

"Software model", click Modify,

For example:

  

 

 3. Add custom Fields

On the modify page, select field management and add a new field.

The field parameters are as follows:

The text in the form prompt is a small icon in the homepage list (you can set it to any name. This is only a prompt when you add an article in the background .)

Field name: indeximg

Field Type: the system automatically generates form fields.

Foreground parameter: No

Pagination of content: No

Data Type: image (URL only)

Default Value: NULL

Maximum length: 250 by default

Custom form html: empty

Click "OK" to add a custom field. Then, go to the software channel and add the software. An additional attribute box is displayed. This is the first

Select box for customizing small icons on the page.

  4. Homepage call code

The call code is as follows:

{Dede: arclist flag = 'A' addfields = 'incluximg 'titlelen = 42 channelid = 3 row = '6'} <li class = 'indexline'> <a href = "[field: arcurl/] "class =" indextitle "> [field: array runphp = 'yes'] @ me = (empty (@ me ['inputmg '])? " ": " [field: title/] </strong> </a> </li> {/dede: arclist} Note: The red part above indicates the image to be returned if no custom small icon is specified, change it to an image of your website. V. Code Parsing{Dede: arclist flag = 'A' addfields = 'destximg 'titlelen = 42 channelid = 3 row = '6'} In addfields = 'destximg' load the index of the indeximg segment, so that the following [field: array runphp = 'yes'] @ me = (empty (@ me ['inputmg '])? "Get the value of the indeximg field. @ Me = (empty (@ me ['inputmg '])? Determines whether the field is empty if the Custom Field indeximg is empty, return: is the value of the indeximg field. For details, see "Design by www.badubox.com!

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.