441
織夢DedeCMS
站內新聞_織夢CMS幫助中心
一、站內新聞插件的安裝
在我們進入站點後台管理模塊列表裏,找到站內新聞後麵對應的“未安裝”,單擊其接著進入安裝界麵,再單擊確定即可完成此插件的安裝。
圖1
圖2
二、站內新聞插件的使用
站內新聞是為了方便站長發布站點公告而設置的一種小功能,由於要讀取包括text字段的信息,應定期刪除太舊的信息,否則可能會讓模板解析速度變慢。如果沒有選擇顯示頻道,則在這個頻道中使用這個標記時會被“所有位置...”的標記內容代替。
很多站長朋友希望使用dedecms站內新聞插件來做站內公告,下麵以此為例介紹站內插件的使用。安裝好站內新聞插件之後,我們登錄後台會看到一個。
圖3
站內新聞調用代碼:
{dede:mynews row='條數' titlelen='標題長度'}Innertext{/dede:mynews},Innertext支持的字段為:[field:title /],[field:writer /],[field:senddate /](時間),[field:body /]
我們在templets新建一個模板文件夾test,在文件夾test裏麵新建一個index.htm文件,index.htm文件代碼為:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
<style type="text/css">
.zngg {
height: auto;
width: 300px;
font-size:12px;
padding:10px;
border: 1px solid #cccccc;
}
.title{color:#F00;
font-weight:bold;
float:left;
}
.other{
float:right;
}
</style>
</head>
<body>
<div class="zngg">
{dede:mynews row='2' titlelen='20'}
<div class="title">公告[field:title /]</div>
<div class="other">由[field:writer /]於[field:senddate function="MyDate('Y-m-d',@me)" /]發布</div>
<div style="clear:both;"></div>
<hr />
[field:body /]
{/dede:mynews}
</div>
</body>
</html>
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
<style type="text/css">
.zngg {
height: auto;
width: 300px;
font-size:12px;
padding:10px;
border: 1px solid #cccccc;
}
.title{color:#F00;
font-weight:bold;
float:left;
}
.other{
float:right;
}
</style>
</head>
<body>
<div class="zngg">
{dede:mynews row='2' titlelen='20'}
<div class="title">公告[field:title /]</div>
<div class="other">由[field:writer /]於[field:senddate function="MyDate('Y-m-d',@me)" /]發布</div>
<div style="clear:both;"></div>
<hr />
[field:body /]
{/dede:mynews}
</div>
</body>
</html>
生成效果圖:
圖4
三、站內新聞插件的卸載
如果大家需要卸載站內新聞插件,可以從按照以下順序來進行卸載,進入站點管理係統後台模塊管理列表,找到站內新聞後麵對應的“卸載”,單擊它進入卸載頁麵,再單擊“確定”,接著等待係統為您完成此插件的卸載任務,過程如以下圖示。
圖5
至此,站內新聞插件就介紹完了。
最後更新:2016-12-29 14:26:08