Functions required for building a classification information model of dedecms

Source: Internet
Author: User

Recently, the Shiyan real estate network (www.0719ol.cn), which has not been properly established for a long time, has been installed with the latest dedecms5.7 and is ready to use the classification information model to build a small real estate site in a local area. After about six hours of debugging, the necessary functions were basically adjusted. Because the classification information model of zhimeng is not as perfect as the document model, I will share with you some of the main problems and solutions I encountered during my website creation for your reference.

Keyword and Description field vacancy of dedecms category Information

The dedecms5.7 version does not seem to have any keyword or description when releasing the category information. This will cause the two content missing on the final page.

Solution:

1. Create two fields in model management in the background, including keywords and descriptions. The code for adding keywords and descriptions in Model Field Configuration (text mode) is as follows:

<Field: guanjianci itemname = "keyword" autofield = "1" notsend = "0" type = "text" isnull = "true" islist = "1" default = "" maxlength = "250" page = "">
</Field: guanjianci>
<Field: miaoshu itemname = "Description" autofield = "1" notsend = "0" type = "text" isnull = "true" islist = "1" default = "" maxlength = "250" page = "">
</Field: miaoshu>

The above highlighted red is the custom field when you create a new one (according to the system requirements, it is OK, you can write it casually, the first needs to correspond), you can modify it here after adding, the keywords and descriptions that need to be entered are displayed when category information is published, but the page call will fail because the default keyword and description are called as follows:

<Meta name = "keywords" content = "{dede: field. keywords/} "/> <meta name =" description "content =" {dede: field. description function = 'html2text (@ me) '/} "/>

Its fields do not match the ones we created, so we need to modify them as follows:

<Meta name = "keywords" content = "{dede: field. guanjianci/}"/>
<Meta name = "description" content = "{dede: field. miaoshu/}"/>

After modification, the keywords and descriptions will come out when you post the information!

Dedecms classification information model not displayed in the previous article

This is also a very common problem. You may habitually take the label of the article model for use. In fact, after writing the label, you need to modify a system file (Path:/include/arc. archives. class)

Search

$ Next = (is_array ($ nextR )? "Where arc. id = {$ nextR ['id']}": 'Where 1> 2'); $ pre = (is_array ($ preR )? "Where arc. id = {$ preR ['id']} ": 'Where 1> 2'); $ query =" Select arc. id, arc. title, arc. title, arc. typeid, arc. ismake, arc. senddate, arc. arcrank, arc. money, arc. filename, t. typedir, t. typename, t. namerule, t. namerule2, t. ispart, t. moresite, t. siteurl, t. sitepathfrom 'dede _ archives 'arc left join dede_arctype t on arc. typeid = t. id "; change to $ next = $ pre =" "; // Add support for independent tables by koruiif ($ this-> ChannelUnit-> ChannelInfos ['Issystem']! =-1) {$ next. = (is_array ($ nextR )? "Where arc. id = {$ nextR ['id']}": 'Where 1> 2'); $ pre. = (is_array ($ preR )? "Where arc. id = {$ preR ['id']} ": 'Where 1> 2'); $ query =" Select arc. id, arc. title, arc. title, arc. typeid, arc. ismake, arc. senddate, arc. arcrank, arc. money, arc. filename, t. typedir, t. typename, t. namerule, t. namerule2, t. ispart, t. moresite, t. siteurl, t. sitepathfrom 'dede _ archives 'arc left join dede_arctype t on arc. typeid = t. id ";} else {$ next. = (is_array ($ nextR )? "Where arc. aid = {$ nextR ['id']}": 'Where 1> 2'); $ pre. = (is_array ($ preR )? "Where arc. aid = {$ preR ['id']} ": 'Where 1> 2'); $ query =" Select arc. aid as id, arc. title, arc. typeid, arc. senddate, arc. arcrank, t. typedir, t. typename, t. namerule, t. namerule2, t. ispart, t. moresite, t. siteurl, t. sitepathfrom '". $ this-> ChannelUnit-> ChannelInfos ['addtable']. "'arc left join dede_arctype t on arc. typeid = t. id ";}

In this way, the previous and next articles of classification information can be displayed normally!

The category information model is not displayed on the list page or on the homepage.

This is actually quite easy to modify. I will directly send a piece of written code for your reference:

{Dede: arclistsg typeid = '1, 18 'row = '20' titlelen = '60' addfields = 'tel' addfields = 'linkman, tel 'imgwidth = '000000' imgheight = '000000' channelid = '-8 '}
<Li style = "float: left; width: 125; height: 114px; overflow: hi"> <a href = "[field: arcurl/] "class =" title "> <span style =" margin-right: 10px; "> [field: image/] </span> </a> </li>
<Li> <a href = "[field: arcurl/]" class = "title" style = "color: #316301;"> [field: title/] </a> <span class = "date"> [field: pubdate function = "GetDateTimeMK (@ me)"/] </span>
<P style = "line-height: 20px;"> browsing times: [field: click/] | contact: [field: linkman/] | contact number: [field: tel/] </p>
<P style = "line-height: 20px; margin-right: 10px;"> property details: [field: body function = cn_substr (Html2Text (@ me), 200) /]... <a href = "[field: arcurl/]"> [view full text] </a> </p>
</Li>
{/Dede: arclistsg}

To put it simply:

Addfields = 'linkman, tel' is used to control the fields to be displayed, such as the contacts and phone numbers I need.

Imgwidth = '000000' imgheight = '000000'. This is used to control the size and size of the output thumbnail.

[Field: body function = cn_substr (Html2Text (@ me), 200)/] This section is an invincible label for calling abstract that I found online, literally, the content should be truncated.

Finally, all the debugging results can be found.

This article is published at http://www.huangao.info/archives/333,the transfer request must be noted.

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.