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

Blog Posts for Contents Component

The Blog Posts for Contents component is to put links to relevant blog posts on the main content page. The relevant contents are calculated by the keyword tag groups.

Appearance and usage of the Blog Posts for Contents Component

The Blog Posts for Content is used on the template of the Default Page. It shows links to the relevant blog entries on it.

Blog posts on the main contents

This component helps to make the website structure using the Content Management System and Blog.

The main contents has this part after the body of article, in the default setting. By adding the blog page, the entries on this component increases, and the main content pages work as rich blog category.

Source code of the Blog Posts for Contents Component

The Blog Posts for Contents Component consists of Html code, server side program, and Style Sheet.

Html code

The Html code of the Blog Posts for Contents Component is below.

This component is shown when there are relevant blog posts. The "@cms_page" variable is the list of them.

The variable is created by the server side program.

Server side program

The server side program of the Blog Posts for Contents Component is below.

This program is to make the "@cms_page" variable by following operations.

Set number to show the blog posts

At first, it sets value of the "$numBlogPosts" variable. This means the number of blog posts to show on the list.

Select tag for current page

It queries the "cms_tag" table to get keyword tag whose representing page is current page.

Get pages with the tag

After getting keyword tag's information, select the blog article pages which have the tag. This variable is to be used in the Html code.

Style Sheet

The Style Sheet of the Blog Posts for Contents Component is below.

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


Go to Top