建站帮助

诚信合作, 高质专业!

Phpcms V9设置网站地图Sitemap静态地图的两种方法

2015-05-27 20:20:00 浏览 我要评论

3、可选:扩展》菜单管理》新建菜单,添加一个菜单,为刚才新增加的模型添加一个菜单,图示:

sitemap

 

Phpcms V9设置网站地图Sitemap静态地图方法二:通过新建栏目生成sitemap.html。

具体方法:

1、新建模板文件page_sitemap.html,存放在模板目录文件夹下,比如:phpcms/templates/default/content/page_sitemap.html(其中黄色部分default是你的模板文件夹目录),内容为:

{template "content","header"}
<div class="page_containter">

<div class="textcontent">

          <table width="680" border="0" cellspacing="3" cellpadding="3" class="font">
              <tbody>
{pc:content action="category" catid="0" num="7" siteid="$siteid" order="listorder ASC" return="sitemap"}
                  <tr> 
                    <td style="line-height: 150%" width="80" align="center"><a href="{APP_PATH}">Home</a></td>
                    <td style="line-height: 150%"></td>
                  </tr>
{loop $sitemap $k $r}
                  <tr> 
                    <td style="line-height: 150%" width="80" align="center"><a href="{$r[url]}">{$r[catname]}</a></td>
                    <td style="line-height: 150%" >
{if $r[child]}
{pc:content action="category" catid="$k" num="20" siteid="$siteid" order="listorder ASC" return="submenu2"}
{loop $submenu2 $k $r}
                        <a href="{$r[url]}">{$r[catname]}</a> &nbsp; 
{/loop}
{/pc}
{/if}
                    </td>
                  </tr>
{/loop}
{/pc}
 </tbody>
          </table>
    </div>
    <div class="clear"></div>
</div>
{template "content","footer"}

2、在后台:内容》栏目管理 里边,添加单页:网站地图,设置生成html,文件为:sitemap.html,设置生成在网站根目录,模板文件选择page_sitemap.html。

这样sitemap栏目就建好了,批量更新栏目页就可以生成一个Sitemap.html静态地图。

 

大家可以试试,碰到问题可以到CMS互助问答里边提问:http://www.cmsyou.com/forum/

我要收藏
点个赞吧

相关阅读

本月热门

精选推荐

在线客服

扫一扫,关注我们

扫一扫,关注我们