posted time Created time: 2015-07-10 posted time Last updated time:

Tagged Pages Component

The Tagged Pages Component shows the list of pages which has current keyword tag. This component implements paging function.

Appearance and usage of the Tagged Pages Component

The Tagged Pages Component is used on the template of Keyword Tag Page. This component shows the tagged pages with pagination.

Tagged pages component

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.

Source code of the Tagged Pages Component

The Tagged Pages Component consists of Html code, server side program, and Style Sheet.

Html code

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.

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.

Get pages

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.

Pagination code

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.

Style Sheet

The Style Sheet of the Tagged Pages Component is below.




Go to Top