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

Blog Side Part Component

The Blog Side Part Component is to show the latest blog posts on the side bar or part after the body content.

Appearance of Blog Side Part Component

The Blog Side Part is used on the Template of Blog Top Page, Blog Category Page, and Top Page.

This component makes list of new articles like below.

Latest blog part

This parts is effective to notice a new article is published. When the crawler fetch these pages, which have this component, it definitely recognize the new blog entry by the link.

Source code of Blog Side Part Component

The Blog Side Part Component's source code consists of Html code, server side program, and Style Sheet. This component is simple, it just list the latest blog articles.

Html code

The Html code of this component is below.

This Html code uses the "@cms_page" variable. This variable is an array of the blog pages. The server side program create this variable.

In order to change the number of list, please take a look at server side program.

Server side program

The server side program of the component is below.

The main job of this program is to create the "@cms_page" variable, by following operation.

Set number of the articles show

At first, set the "$limit" variable. This variable means the number of links to the latest blog article. Therefore if you want to change the number, please update the variable's value.

Get latest articles

The "getLatest()" function get the latest blog articles from the database by SQL query.

The blog articles should be located under the "/blog/" directory or the child ones, and have "blog" value as the content type.

Style Sheet

The Style Sheet of the component is below.

When you change the design, please change the Style Sheet, and if necessary, Html code.


Go to Top