Sitemap and Partial Sitemap
The Sitemap and Partial Sitemap component can put tree structured link list on the contents edited with WYSIWYG editor.
The Sitemap and Partial Sitemap component are to show the pages with site structure. The Sitemap shows entire website's structure, and the Partial Sitemap shows the page structure starts with specified page.
The sitemap component is used to create the sitemap page, which includes all of the pages in the website. In order to make it, just locate the component on the body of content like below.
The component is replaces into the list of page links on publish.
The Partial Sitemap is used to the pages which are high level pages on the page hierarchy.
For example, the Top page uses this like below.
This component is converted into following Html part on publish.
On adding the Partial Sitemap, we can set the depth of the child hierarchy by parameter of this component.
If the parameter is not set, all of the pages under the page are listed.
The Sitemap Component consists of Html code, server side program, and Style Sheet.
The Html code of the Sitemap Component is below.
This Html code output within 4 hierarchy of the page structure. If you want to increase the depth of the page hierarchy, add Html code to output more hierarchy.The "@cms_page" variable is created by the server side program.
The server side program of the Sitemap Component is below.
This server side program is to create the "@cms_page" variable by following operations.
Get current page and the Root path of the tree node
At first, the "getPage()" function returns the record of current page, which is the page to show the sitemap.
And the "getRootPath()" function returns the path of the root of the website. This CMS can manage multiple website, therefore each website has own path in the tree node engine.
Get main contents record from database
On this operation, get the 2nd level pages from the database by SQL query, and get child pages by the "getChildNodes()" function.
The "getChildNodes()" function is called recursively inside it.
On this operation, it gets only the main contents. The blog posts are done by next operation.
Get blog articles
Get the blog articles from the database record. And the "getMainBlogCmsPageId()" function calculate the parent main contents from the keyword tags setting.
Incorporate main content pages with blog articles
After calculating the main content where the blog article pages belong, add them to the tree structured variable of the main content pages.
The "incorporateBlog()" function does that.
The Style Sheet of the Sitemap Component is below.
When you customize the design of the sitemap, please customize this Style Sheet, and the Html code.