Home Articles Videos & Tutorials Controlling homepage via system topic
Rate this article
3.38
More from Videos & Tutorials

Controlling homepage via system topic

Filed under: Developer Tools

This developer tutorial focuses on utilizing system tags and topic for controlling main frame templates - homepage, categories and article pages.

Introduction: Creating "Headlines" section on Vivvo homepage

In this example we shall analyze "headline" section on homepage and show how system topic with its tags can be used in Vivvo box_article_list module to filter output based on tag we want. The working example can be vivewed on http://www.myvivvo.com/new/ live demo.

 

"Headline" section is filtered using two tags within system topic: headline and homepage

 

Vivvo box_article_list module

In Vivvo box_article_list module is responsible for retrieving articles from database and formatting them for output. From Vivvo 4.5, the <params> array of box_article_list can filter output by tag ID which can be used to 

For detailed explanation on Vivvo modules, please reference Wiki developer documentation on box_article_list and modules in general.

For headline section, box_article_list <param> array looks like this (/templates/xhtml/box/headlines.tpl file):

<vte:box module="box_article_list">
		<vte:params>
			<vte:param name="search_topic_id" value="1" />
			<vte:param name="search_all_tag_ids" value="1,2" />
			<vte:param name="search_sort_by" value="order_num" />
			<vte:param name="search_order" value="descending" />
			<vte:param name="cache" value="1" />
			<vte:param name="add_to_printed" value="true" />
			<vte:param name="exclude_printed" value="true" />
		</vte:params>

Two parameters are in the focus here - "search_topic_id" and "search_all_tag_ids" and they need to be passed with ID's of topic and tags respectively you want to filter output by. In this example, homepage (id=1) and headline (id=2).

In every default Vivvo installation System topic has always ID=1 and first three tags within System topic are: homepage, headlines and video.

Creating new sections

Creating new sections (boxes), such as "breaking news" or similar is quite easy, all you need do is following:

1. Create appropriate tags in Topic:: System

Go to Control Page -> Categories, expand Topics tab on left-hand side and add tags to topic System. Add tags you want, like: breaking news, editors pick, hot stories, etc.

2. Create box template for particular article queue you want to have 

In /box folder of active template set create template for desired article queue (i.e. breaking.tpl, editors.tpl) and following above pattern create the output. 

3. Tag articles for desired queue. 

In Control Panel -> Content -> Articles tag the articles with appropriate tags to have them displayed in desired section on page. 


Conclusion

The goal of this "topic-controlled templates" approach is to have distinctive way to easily create and manipulate with article queues such as headlines, breaking news, editor's picks or any desired ones on main frame templates - homepage, categories, etc. Combining queue tag (headlines, breaking news) with tag that designates a template (homepage, sports, politics) you can easily allow editors and writers to set and relocate articles automatically on various parts of the website.

 

Share on: Post on Facebook Facebook Add to your del.icio.us del.icio.us Digg this story Digg StumbleUpon StumbleUpon Twitter Twitter
Follow us on Twitter cron