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

Blog Tags Component

The Blog Tags Component shows the keyword tags with links to the page, which the current page has. The most important keyword tag is used in creating bread list, therefore it shows keyword tags except it.

Appearance and usage of the Blog Tags Component

The blog Tags Component is used on the Blog Article Page.

This component shows the tags of the article.

Blog tags

The links to the tag page has following 2 types.

  • Link to the main content page
  • Link to the keyword tag page

The icons of the tags differ by these types.

Source code of the Blog Tags Component

The source code of the Blog Tags Component consists of Html code, Server side program, and Style Sheet.

Html code

The Html code of the Blog Tags Component is below.

The Html code uses the "@cms_tag_page" variable. It has information about the keyword tags of this page. The server side program make it.

The icons of the links has 2 types. The links to the main contents and the links to the tag page. The case statement using "alns:if" attribute decide which icon to use.

Server side program

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

The server side program makes the "@cms_tag_page" variable by following operations.

Get keyword tags of current page by SQL query

Get keyword tags except the most important keyword tag of this page by SQL query. The offset is 1 because the first tag is the most important one which has biggest weight value.

Exclude tag used in Bread List

Trim the tag which is used as the bread list.

Set url of the keyword tag page if exists

Set url to each keyword tag by using the "getUrl()" function.

Style Sheet

The Style Sheet of the Blog Tags Component is below.

Image Resource

This component uses following image icon. This icon is for main content links.

Main contents icon

Go to Top