Home Articles Videos & Tutorials Using VTE to prevent duplicate content in pages
Rate this article
5.00
More from Videos & Tutorials

Using VTE to prevent duplicate content in pages

Filed under: Developer Tools

In scenarions where an article is posted in multiple sections or blocks, there's an easy way they to selectively exclude them from constructing any block.

To prevent duplicate content on a page, Vivvo uses very straightforward mechanism of flagging articles within PARAMS array of box_article_list module. 

<vte:box module="box_article_list">
    <vte:params>
        <vte:param name="search_sort_by" value="created" />
        <vte:param name="search_order" value="descending" />
        <vte:param name="search_cid" value="1,3,5" />
        <vte:param name="search_limit" value="10" />
        <vte:param name="add_to_printed" value="true" />
        <vte:param name="exclude_printed" value="true" />
    </vte:params>

 

add_to_printed param, when set to TRUE instructs box_article_list module to flag the articles as used. These articles will not appear again throughout the same page, if exclude_printed param is set to TRUE. 

exclude_printed param, when set to TRUE instructs box_article_list module not to use flagged articles when constructing query and fetching articles from database.

Vivvo parser uses "First served" mechanism to flag articles, from beginning to end of a template.


Usage Scenarios

Combining these two params, you can effectively manipulate appearance of articles (content) throughout the page. For example, boxes such as "Most popular" or "Most commented" will have: <vte:param name="exclude_printed" value="false" />, since you obviously want to display popular articles regardless of if they are already printed anywhere on page. On the other hand, for articles in Headline section or Breaking news, you will use: <vte:param name="exclude_printed" value="true" />, since you don't want same article to appear as "Headline" and as "Breaking News" at the same time.  

 

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