❶ 怎麼製件網站地圖自動生成sitemap
方法/步驟
1
登陸wordpress站點後台,本文的操作需要安裝Dagon Design Sitemap Generator 插件,請在安裝好插件後,啟用,
地址可查看下方注意事項,如何安裝插件,請參考:
0Wordpress,後台怎麼安裝插件如何上傳本地插件
2
從設置中進入DDSitemapGen相應的配置頁面.為了方便操作,請先將插件語言,改為SimplifiedChinese.
3
待界面由英文轉換成簡體中文後,將內容選項中的
如果都顯示,哪個在前,改為頁面在前
文章排序方式,改為按發布時間
頁面排序方式,設置按發布時間
4
為了便於後期網友瀏覽,將在新窗口中打開站點地圖頁面中的所有鏈接,打勾,然後點擊 更新設置,來保存修改
5
經過以上設置後,點擊 儀表盤下的 頁面鏈接,繼續操作
6
經過以上設置後,點擊 儀表盤下的 頁面鏈接,繼續操作
7
這里建議,將新創建的頁面,命名為 網站地圖,然後進入內容編輯框右上角的 文本,輸入 以下內容<!-- ddsitemapgen -->,注意只有這一行,不要加任何其他的內容.
8
待網站地圖下方的固定鏈接,生成後,點擊右側的編輯,將原來的鏈接名稱修改為 你的域名/sitemap,然後保存頁面
9
此時在返回的頁面列表中,可以看到新建的 網站地圖頁面,點擊 查看
10
在打開的網站地圖頁面中,此時就可以看到剛剛創建的網站地圖了,以後只要有新的文章,這個頁面就會自動更新內容.17:44 2016/5/7
❷ 關於asp.net中web.sitemap
如果使用sitemap的話 估計不行吧。 sitemap文件只能有一個siteMapNode根節點,你這3個節點是同級的啊。
要不你試試自己創建MenuItem的方法。
另外問一句,在頁面導航直接用html代碼的不就行了嗎?
❸ web.sitemap的用法
Web.sitemap 導航XML文件
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="首頁" url="SiteMapTest.aspx" >
<siteMapNode title="產品" roles="*">
<siteMapNode title="Windows" url="SiteMapTest.aspx?id=windows" />
<siteMapNode title="Office" url="SiteMapTest.aspx?id=office" />
<siteMapNode title="Mobile Devices" url="SiteMapTest.aspx?id=mobile" />
<siteMapNode title="Business Solutions" url="SiteMapTest.aspx?id=business" />
<siteMapNode title="Servers" url="SiteMapTest.aspx?id=servers" />
<siteMapNode title="Developer Tools" url="SiteMapTest.aspx?id=tools" />
<siteMapNode title="Games and XBox" url="SiteMapTest.aspx?id=games" />
<siteMapNode title="All Procts" url="SiteMapTest.aspx?id=all" />
</siteMapNode>
<siteMapNode title="資源" roles="*">
<siteMapNode title="支持" roles="*">
<siteMapNode title="修改密碼" url="~/Login/ChangePassword.aspx" />
<siteMapNode title="Knowledge Base" url="SiteMapTest.aspx?id=knowledge" />
</siteMapNode>
<siteMapNode title="Downloads" url="SiteMapTest.aspx?id=downloads" />
<siteMapNode title="Windows Update" url="SiteMapTest.aspx?id=windowsupdate" />
<siteMapNode title="Office Update" url="SiteMapTest.aspx?id=officeupdate" />
<siteMapNode title="Learning Tools">
<siteMapNode title="Training & Certification" url="SiteMapTest.aspx?id=training" />
<siteMapNode title="Books" url="SiteMapTest.aspx?id=books" />
<siteMapNode title="Events & Webcasts" url="SiteMapTest.aspx?id=events" />
<siteMapNode title="Patterns & Practices" url="SiteMapTest.aspx?id=patterns" />
</siteMapNode>
<siteMapNode title="Community" url="SiteMapTest.aspx?id=community" />
<siteMapNode title="Security" url="SiteMapTest.aspx?id=security" />
</siteMapNode>
<siteMapNode title="RSS" roles="*">
<siteMapNode title="公司關系" url="SiteMapTest.aspx?id=relations" />
<siteMapNode title="RSSSite" url="~/RSS/RSSSite.aspx" />
<siteMapNode title="Careers" url="SiteMapTest.aspx?id=careers" />
<siteMapNode title="About this Site" url="SiteMapTest.aspx?id=about" />
</siteMapNode>
</siteMapNode>
</siteMap>
Web.sitemap文件必須包含根結點sitemap。一張站點地圖由一系列相聯系的SiteMapNode對象組成。這些SiteMapNode以一種層次方式聯系在一起。該層次包含單個根結點-它是該層中唯一的一個沒有父結點的結點,代表首頁。在該父sitemapnode結點下,可以有若干個子sitemapnode結點,分別按層次結構代表了網站的各子欄目(留意一下上例中,各個子結點之間的包含關系)。
❹ 怎麼創建網站地圖
建網站地圖我們常說的有兩種,一是html我們自己做的一個個文字鏈接導航,這樣用一個文件幾乎把網站所有的頁面都能連上交html地圖,另外,可以建.xml的地圖,提交到google管理員,可以用在線工具,你google一下即可!
❺ ASP.NET Web.sitemap 站點地圖文件怎麼來 我用的是VS2008
你說的是這個吧
❻ C# 定義一個具有三級節點的站點地圖文件Web.sitemap
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="" description="圖書展示區">
<siteMapNode url="" title="" description="軟體編程類">
<siteMapNode url="#" title="" description="ASP.NET程序設計" />
<siteMapNode url="#" title="" description="C#2008網路技術詳解" />
</siteMapNode>
<siteMapNode url="" title="" description="硬體開發類">
<siteMapNode url="#" title="" description="8051單片機程序設計" />
<siteMapNode url="#" title="" description="Linux設備驅動程序開發" />
</siteMapNode>
</siteMapNode>
</siteMap>
❼ asp.net C# 生成sitemap.xml 問題
給你一點參考吧~~這是我以前寫的一個動態生成站點地圖的~~一個簡單實例方法~~~~~~你可以看一下~~~注釋很清楚
首先前台將Web.SitMap的物理路徑傳入CreatSiteMap(string path)方法就可以了~[string path=Server.MapPath("~/Web.sitemap");]
其次關於資料庫這邊我就是通過GetList(string strWhere)提供的DataTable方法來實現的當然這里根據自己需要來設計資料庫不過至少要提供Web.SitMap的三個基本屬性~~~當然需要更多的自己可以在ChildNodesCreate(ref XmlDocument doc,ref XmlElement t,DataRow row)方法內添加就行了注釋的很清楚~~
/// <summary>
/// 查詢多條數據
/// </summary>
/// <param name="strWhere">要查詢的條件</param>
/// <returns>返回一個DataTbale查詢集合</returns>
public DataTable GetList(string strWhere)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select * from company_title ");
if (strWhere.Trim() != "")
{
strSql.Append(" where " + strWhere);
}
return DBLink.ToDataTable(DBLink.ExecuteReader(strSql.ToString()));
}
/// <summary>
/// 生成Web.Sitemap站點地圖的的方法
/// </summary>
/// <param name="path">站點地圖所在物理路徑</param>
/// <returns>生成是否成功</returns>
public bool CreatSiteMap(string path)
{
AddWebSiteMap(path);//創建XML
XmlDocument doc = new XmlDocument();
doc.Load(path);//獲取XML對象
XmlNode node = doc.DocumentElement;//創建根節點
//創建根節點的一個屬性
XmlAttribute mains = doc.CreateAttribute("xmlns");
mains.Value = "http://schemas.microsoft.com/AspNet/SiteMap-File-1.0";
node.Attributes.Append(mains);//將屬性添加到根節點
//查詢根節點(首頁)
string strWhere = " titleid=0 and titlevisible=0 and titletype=0 ";
DataTable table=GetList(strWhere);
/////////////////
for (int i = 0; i < table.Rows.Count; i++)
{
//創建一個元素
XmlElement t = doc.CreateElement("siteMapNode");
//添加這個元素的屬性和子節點
ChildNodesCreate(ref doc,ref t,table.Rows[i]);
node.AppendChild(t);//將這個子節點添加到根節點內
}
//////////////////
doc.Save(path);
return true;
}
/// <summary>
/// 遞歸創建節點及其子節點
/// </summary>
/// <param name="doc">XML對象</param>
/// <param name="t">子節點</param>
/// <param name="row">資料庫中取出的要添加的節點對象</param>
/// <returns>是否添加成功</returns>
public bool ChildNodesCreate(ref XmlDocument doc,ref XmlElement t,DataRow row)
{
//添加Web.SiteMap的三個基本屬性
XmlAttribute nodvalue = doc.CreateAttribute("url");
nodvalue.Value = row["TitleUrl"].ToString();
t.Attributes.Append(nodvalue);
nodvalue = doc.CreateAttribute("title");
nodvalue.Value = row["TitleName"].ToString();
t.Attributes.Append(nodvalue);
nodvalue = doc.CreateAttribute("description");
nodvalue.Value = row["TitleName"].ToString();
t.Attributes.Append(nodvalue);
//取出該節點的所有子節點
string strWhere = " TitleFID=" + row["TitleID"].ToString() + " and titlevisible=0 and TitleID<>0";
DataTable table = GetList(strWhere);
//進行判斷是否存在子節點並且進行循環遞歸調用
for (int i = 0;i<table.Rows.Count ;i++ )
{
XmlElement s = doc.CreateElement("siteMapNode");
ChildNodesCreate(ref doc, ref s, table.Rows[i]);
t.AppendChild(s);
}
return true;
}
/// <summary>
/// 創建一個WEB.SiteMap
/// </summary>
public void AddWebSiteMap(string path)
{
XmlWriter xw = XmlWriter.Create(path);
xw.WriteComment("動態生成的站點地圖");
xw.WriteStartElement("siteMap");
xw.WriteEndElement();
xw.Close();
}
上變已經有了給以個節點附加屬性~~以及添加子節點問題~~~~呵呵~~其實就是簡單的DOM解析了~~
❽ C#.net 如何使用 websitemap
你新建一個sitemap項,然後裡面有幾個默認的 siteMapNode項,例如你要的 首頁>>網站>>頁面 效果,就可以寫:
<siteMapNode url="Index.aspx" title="首頁" description="">
<siteMapNode url="website.aspx" title="網站" description="">
<siteMapNode url="page.aspx" title="頁面" description="" />
</siteMapNode>
</siteMapNode>
然後在你需要這個導航的頁面插入一個SiteMapPath控制項就可以了`