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

Latest News Component

The latest News is inline module to add the list of newly updated pages into the contents. The module is added with WYSIWYG Editor.

The pages listed on the component is same with Rss feed,

Appearance and usage of Latest News Component

The Latest News Component has same function with the Blog Side Component. The difference between the part and this is that this component can be located in the content edited with the WYSIWYG editor.

WYSIWYG editor's menu

This component is used when you want to locate the latest blog articles as the news of this website, or make latest news page.

Source code of the Latest News Component Component

The Latest News Component consists of Html code, server side program, and Style Sheet.

Html code

The Html code of the Latest News Component is below.

This Html code uses the "@latest" variable. This variable is array of the latest pages, and it is made by the server side program.

Server side program

The server side program of the Latest News Component is below.

The server side program's goal is to make the "@latest" variable, by following operations.

Set number to show the latest news

At first, set the number of links to the articles as the "$limit" variable. When you change the number of links, please change here.

Get latest news

The "getLatest()" function creates the list of the article links. This function simply query the database in SQL, and get latest articles. The articles are main contents and blog posts.

Style Sheet

The server side program of the Latest News Component is below.

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


Go to Top