婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 網(wǎng)站建設(shè) > 建站知識 > 織夢dedecms分類信息模型建站必調(diào)的幾個功能

織夢dedecms分類信息模型建站必調(diào)的幾個功能

POST TIME:2020-04-10 20:35

  最近把很久沒有搭理的十堰房產(chǎn)網(wǎng)(www.0719ol.cn)進行了一番折騰,裝上了最新的dedecms5.7,準備用分類 信息模型做一個地方的小的房產(chǎn)站點。在經(jīng)歷的大約6個小時的調(diào)試后,基本上完成了必要功能的調(diào)整。因為織夢這個分類信息模型沒有文章模型那么完善,現(xiàn)在把我在建站時遇到的一些主要的問題和解決辦法分享給大家,以供參考。

  dedecms分類信息的關(guān)鍵詞和描述字段空缺

  dedecms5.7的這個版本在發(fā)布分類信息時,貌似沒有關(guān)鍵詞和描述,這個會導(dǎo)致最后的頁面上缺失這2個內(nèi)容。

  解決辦法:

  1.在后臺的模型管理中新建2個字段,分別為關(guān)鍵詞和描述,模型字段配置(文本模式) 下新增的關(guān)鍵詞和描述部分的代碼如下:

<field:guanjianci itemname="關(guān)鍵詞" autofield="1" notsend="0" type="text" isnull="true" islist="1" default="" maxlength="250" page="">
</field:guanjianci>
<field:miaoshu itemname="描述" autofield="1" notsend="0" type="text" isnull="true" islist="1" default="" maxlength="250" page="">
</field:miaoshu>

  其中上面紅色突出標記的是自己新建時自定義的字段(按照系統(tǒng)要求寫就OK,可以隨便寫,首位需要對應(yīng)),可自行修改此處添加完畢之后,在發(fā)布分類信息時就會有需要填寫的關(guān)鍵詞和描述了,但是頁面調(diào)用會出錯,因為默認的關(guān)鍵詞和描述調(diào)用如下:

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

  它的字段是與我們新建的不相符的,所以需要修改為如下:

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

修改后,你在發(fā)表信息時,關(guān)鍵詞和描述就會出來啦!

  dedecms分類信息模型上一篇下一篇不顯示

  這個也是非常常見的一個問題,大家可能 習慣性的把文章模型的標簽?zāi)眠^來用,實際上在寫好標簽之后需要修改一個系統(tǒng)文件(路徑是 /include/arc.archives.class)

  在里面查找

$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.shorttitle,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.sitepath
from `dede_archives` arc left join dede_arctype t on arc.typeid=t.id ";
 
修改為
$next = $pre = "";
//添加對獨立表的支持 by korui
if($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.shorttitle,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.sitepath
from `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.sitepath
from `".$this->ChannelUnit->ChannelInfos['addtable']."` arc left join dede_arctype t on arc.typeid=t.id ";
}

  這樣分類信息的上下篇文章就可以正常顯示啦!

  分類信息模型在列表頁和首頁調(diào)用字段不顯示

  這個其實比較好修改,我直接發(fā)一段寫好的代碼,大家參考一下:

{dede:arclistsg typeid='1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18' row='20' titlelen='60' addfields='tel' addfields='linkman,tel' imgwidth='125' imgheight='114' channelid='-8' }
<li style="float:left;width:125;height:114px;overflow:hi"><a href="[field:arcurl/]" ><span style="margin-right:10px;">[field:image/]</span></a></li>
<li><a href="[field:arcurl/]" style="color:#316301;">[field:title/]</a><span>[field:pubdate function="GetDateTimeMK(@me)"/]</span>
<p style="line-height:20px;">瀏覽次數(shù):[field:click/] | 聯(lián)系人:[field:linkman/] | 聯(lián)系電話:[field:tel/]</p>
<p style="line-height:20px;margin-right:10px;">房產(chǎn)詳情:[field:body function=cn_substr(Html2Text(@me),200)/]...<a href="[field:arcurl/]">[查看全文]</a></p>
</li>
{/dede:arclistsg}

  簡單的說一下:

  addfields='linkman,tel' 這段是來控制需要展示的字段的,比如我這需要的聯(lián)系人和電話

  imgwidth='125' imgheight='114' 這個是來控制輸出的縮略圖大小尺寸的

  [field:body function=cn_substr(Html2Text(@me),200)/] 這段是我在網(wǎng)上搜索到的,一個無敵的調(diào)用摘要的標簽,字面上來看應(yīng)該是截斷內(nèi)容

  最后全部調(diào)試好的結(jié)果,大家可以在http://www.0719ol.cn/看到,最后說一下,如果大家需要使用火車頭采集,然后又添加了自定義字段時,需要看看模塊的內(nèi)容發(fā)布參數(shù)里面的dede_addonfields這個表單里面是否已經(jīng)按照對應(yīng)的格式添加好了自己自定義的字段,不然采集器就無法采集自定義的字段啦。



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 扶沟县| 麻栗坡县| 滨海县| 汉源县| 庄浪县| 广东省| 彭山县| 罗山县| 修水县| 洱源县| 奎屯市| 庆元县| 河北省| 万年县| 乌拉特前旗| 宜良县| 许昌市| 开江县| 大英县| 马山县| 云阳县| 罗源县| 太康县| 平阴县| 来安县| 普陀区| 东莞市| 儋州市| 鱼台县| 赫章县| 陕西省| 明溪县| 綦江县| 永平县| 通河县| 三台县| 苍梧县| 上高县| 禹城市| 宁国市| 澳门|