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

More Topics Link component for CMS Template

The More Topics Link component is for recommendation engine using the keyword tag group. It show list of links to the named anchor on the header tag.

Appearance of the More Topics component

The More Topics component is a widget to show the list of links to relevant Html section like following picture.

Recommended topics by more topics component

This component helps to reduce the bounce rate of this page. In addition to that, effective internal links are generated by this recommendation engine.

Usage of this recommendation widget

This component is used in following templates.

  • Default Page

This component generates links to the Html section which is relevant to current contents.

The links are calculated by the keyword tags of current page and other pages, and contents of target pages. The target pages are of main contents and blog articles.

The anchor text of the links are generated from the text of header tags. And the keywords which relevant to current page's tag are selected automatically.

Source code of the More Topics component

The More Topics component consists of Html code, Server side program, and Style Sheet. The server side program uses Java function to calculate the score of relevance from the keyword tag setting.

Html code

The Html code of this component is below.

This Html code is to expand and show the "@pages" variable, which is created by the server program. The number to show the result links are set in the server side program.

Server side program

The server side program of the More Topics is below.

This program create the "@page" variable, which is used in Html code generation, by following operations.

Set limit to show

At first, set the number to show the recommendation links into the "$limit" variable. The "$innerLimit" variable is the limit of the links which is used internally on calculation.

The links more than the limit number is trimmed by the last operation.

Get pages which has common tags with this page

By using SQL query, selecting pages which has common keyword group tags with current page.

Calculate page score and sort pages

The "HtmlFtech.evaluatePageScore()" function actually calculate the score of each page. This function is implemented by Java programming language.

That is because the scoring algorithm includes complex operations.

The "getKeywords()", and "getPageBeans()" function is to create variable to input into the Java function.

After calculating the score, the function returns array of pages with the score. Then "Variable.sort()" function sort the array variable by the page score.

Trim low score pages

The array variable returned by the "HtmlFtech.evaluatePageScore()" function has more elements than the limit, because it uses internal limit value.

Therefore it removes low score elements whose order in the array is over the limit number of the links list to show.

Style Sheet

The Style Sheet of the More Topics is below.

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

Go to Top