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

Relevant Blog Articles Component

The Relevant Blog Articles Component is to show the blog articles which are relevant to the current blog article. This component is used on the Blog Article page.

Appearance and usage of the Relevant Blog Articles

The Relevant Blog Articles Component is to set links to the relevant blog entries, like below.

Relevant blog posts

The internal links are very important to succeed in SEO. Therefore you have to set a lot of links relevant to current contents.

This component calculate the relevance from the keyword tags, and set the links.

Source code of the Relevant Blog Articles

The source code of Relevant Blog Articles consists of Html code, Server side program, and Style Sheet.

Html code

The Html code of the Relevant Blog Articles is below.

This Html code uses the "@cms_page" variable, which is created by the server side program.

Server side program

The server side program of the Relevant Blog Articles is below.

The goal of this program is to create the "@cms_page" variable, which has relevant articles, by following operations.

Get blog article records from the database by SQL query

At first, get the relevant blog articles by the SQL query.

This query selects the blog articles which has same keyword tags, and order by the number of common tags.

Calculate the url of relevant blog articles

After getting the list of relevant articles by SQL query, set the url for each records.

Style Sheet

The Style Sheet of this component is below.


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



Go to Top