Tagged Pages Component
The Tagged Pages Component shows the list of pages which has current keyword tag. This component implements paging function.
The Tagged Pages Component is used on the template of Keyword Tag Page. This component shows the tagged pages with pagination.
This component implements the pagination function. Therefore if you use this component on the Top Template, it have to implement the "prev" and "next" attribute of the meta tag.
The content of this component build the network of pages which have same topic. Therefore it is effective to build good internal links for both human and search engines.
The Tagged Pages Component consists of Html code, server side program, and Style Sheet.
The Html code of the Tagged Pages Component is below.
This Html code uses the "$cms_tag", "@cms_page", "$navi" variables. They are created in the server side program.
The server side program of the Tagged Pages Component is below.
The goal of this program to create variables for the list of tagged pages and paging widget.
Set the maximum number of pages in a page
At first, set the "$limit" variable as the maximum number of linked pages on a page.
Get current keyword tag
The "getTagFromPage()" function gets the keyword tag record from the database by SQL query.
After getting the current page's tag, get the list of pages which have the tag by SQL query.
This component implements the pagination, therefore it selects with offset and limit of the records.
Get total records
In order to calculate the pagination navigator widget, the total number of the tagged pages is necessary.
Get variable for navigation parts
The "Paging.getNavi()" function returns object to generate Html for pagination navigation.
This function is defined in the common source code. By including the "/include/paging.alns", this function is available.
In order to implement pagination, the program code to return the total number of the record is necessary.
This program get the tag of current page, and get total number of tagged pages by SQL query at first, and make the number of pages with considering the limit of pages in a page.
The Style Sheet of the Tagged Pages Component is below.