PHPCMS Simple way to make a website map
PHPCMS default seems to have no sitemap label, but when the site column division is very fine, the sitemap is still very necessary, conducive to search engine crawling. Today, Creative Studio is sharing a simple way to implement sitemaps! First of all, we add a new column or add a single page in the column (here to add a single page as a demonstration) and set it not to display in the navigation, the template is manually set to page_sitemap.html, the generation rule is set as follows, and then add the following label in the appropriate position of page_sitemap.html.
{pc:content action="category" catid="0" num="10" siteid="$siteid" order="listorder ASC"}
<h2><a href="{siteurl($siteid)}"> Home page </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}
So, is it easy? The demonstration can be seen in the picture:
Article extension
Many children's shoes after reading this article will: "Which if I have three columns then how to get it"? OK, we will improve it today, and the code is as follows:
{pc:content action="category" catid="0" num="250" siteid="$siteid" order="listorder ASC"}
<h2><a href="{siteurl($siteid)}"> Home page </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}
Related article
-
PHPCMS v9 security Settings, prevention tutorials
This article mainly introduces PHPCMS v9 security Settings, prevention tutorials, need friends can refer to the next2016-09-05 -
phpcms Content details page shows only the date and not the time method
This article mainly introduces the phpcms content details page only shows the date does not show the time method, that is, format the time output method, the need of friends can refer to the next2015-06-19 -
PHPCMSV9 The parent column calls the method of the child column
This article mainly introduces the PHPCMSV9 parent column to call the child column method, this article explains in the secondary column list page call, in the first level column list page call two methods, need friends can refer to the next2015-06-19 -
PHPCMS uses the date function to automatically update footer months and months
This article mainly introduces the PHPCMS use date function to achieve automatic update footer date method, this article can mainly learn the use of date function, need friends can refer to the next2015-06-19 -
phpcms exit cannot synchronously notify discuz solution to the problem
This article mainly introduces the phpcms exit can not synchronize notice discuz problem solution, need friends can refer to2014-12-15 -
Perfect solution for phpcms picture too big to burst the table picture adaptive picture scaled down
The following Xiaobian will bring you a perfect solution to the phpcms picture is too big to break the table picture adaptive picture scaled down. Xiaobian feel very good, now to share with you, but also to give you a reference. Let's take a look2016-10-18
Latest comments