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

Child Tags Component

The Child Tags Component shows the all child tags of current tag page. This component makes effective internal links to the tag pages.

Appearance and usage of the Child Tags Component

The Child Tags Component is used on the template of the Keyword Tag Page. This component shows the child tags of the tag of current page like below.

Child tags

By using this component, the keyword tags page can connect to the relevant tags. The keyword tag pages are marked as "noindex, follow", and they is evaluated.

To keep the quality of contents and links of no-index pages is effective to make the quality of website better.

Source code of the Child Tags Component

The Child Tags Component consists of Html code, server side program, Style Sheet, and image resource.

Html code

The Html code of the Child Tags Component is below.

This code is shown when the current page's tag has child tags. The "$size" variable is the number of the children.

The "$cms_tag" variable is the records of the child tags, which is created in the server side program.

Server side program

The server side program of the Child Tags Component is below.

The main goal of this program is to create the "$cms_tag" variable by following operations.

Get tag of the current page

At first, get current keyword tag by SQL query. And make variables to get child tags from the current tag record.

Get child tags by SQL query

Get the child tags by SQL query by using tree path. The keyword tags have tree structure, and it is implemented by the path string.

Set url to the child tags

The default records after fetched from the database do not have url. Therefore calculate the url if the keyword tag has representing page.

Style Sheet

The Style Sheet of the Child Tags Component is below.

When you change the design of this component, change this Style Sheet and Html code.

Image Resource

The image resource of the Child Tags Component is below.

Image resource


This image is used in the Html code. If you want to change the icon of the tags, upload your own image, and change the Html code.


Go to Top