欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHPCMS制作網(wǎng)站地圖的簡單方法

  發(fā)布時(shí)間:2015-06-19 15:00:41   作者:佚名   我要評論
這篇文章主要介紹了PHPCMS制作網(wǎng)站地圖的簡單方法,本文給出了操作步驟及標(biāo)簽源碼,需要的朋友可以參考下

PHPCMS默認(rèn)好像沒有站點(diǎn)地圖的標(biāo)簽,但是當(dāng)網(wǎng)站欄目劃分的很細(xì)時(shí),站點(diǎn)地圖還是很有必要的,有利于搜索引擎抓取。今天,創(chuàng)想工作室就分享一個(gè)簡單實(shí)現(xiàn)站點(diǎn)地圖的辦法!
 
首先我們在欄目那里新添加欄目或者添加單網(wǎng)頁(這里以添加單網(wǎng)頁為演示)并設(shè)置為不在導(dǎo)航顯示,模板手動(dòng)設(shè)置為page_sitemap.html,生成規(guī)則這樣看情況設(shè)置,然后在page_sitemap.html適當(dāng)位置加上以下標(biāo)簽即可。

復(fù)制代碼
代碼如下:

{pc:content action="category" catid="0" num="10" siteid="$siteid" order="listorder ASC"}
<h2><a href="{siteurl($siteid)}">首頁</a>
{loop $data $r}
<h2><a href="{$r[url]}">{$r[catname]}</a></h2>
{if $top_parentid}
{pc:content action="category" catid="$r[catid]" num="15" siteid="$siteid" order="listorder ASC"}
{loop $data $v}
<p><a href="{$v[url]}">{$v[catname]}</a></p>
{/loop}
{/pc}
{/if}
{/loop}
{/pc}

怎樣,是不是很簡單咧?演示可以看圖:

 
文章延伸

很多童鞋看完這篇文章后會(huì):“哪我要是有三級欄目的話怎么弄呢”?OK,今天就再進(jìn)行完善,代碼如下:
 

復(fù)制代碼
代碼如下:

{pc:content action="category" catid="0" num="250" siteid="$siteid" order="listorder ASC"}
<h2><a href="{siteurl($siteid)}">網(wǎng)站首頁</a>
{loop $data $r}
<h2><a href="{$r[url]}">{$r[catname]}</a></h2>
{if $top_parentid}
{pc:content action="category" catid="$r[catid]" num="150" siteid="$siteid" order="listorder ASC"}
{loop $data $t}
<dl class="left">
<dt><a href="{$t[url]}">{$t[catname]}</a></dt>
{if $t[child]}
{pc:content action="category" catid="$t[catid]" num="150" siteid="$siteid" order="listorder ASC"}
{loop $data $v}
<dd><a href="{$v[url]}">{$v[catname]}</a></dd>
{/loop}
{/pc}
{/if}
</dl>
{/loop}
{/pc}
{/if}
{/loop}
{/pc}

相關(guān)文章

最新評論