Creating custom box article list

Latest articles

This example shows on how to create a simple article list which will show latest five article in ascending order.

<vte:box module="box_article_list">
    <vte:params>
        <vte:param name="search_sort_by" value="created" />
        <vte:param name="search_order" value="ascending" />
	<vte:param name="search_limit" value="5" />
    </vte:params>
    <vte:template>
        <ul>
            <vte:foreach item = "article" from = "{article_list}">
                <li>
                    <a href="{article.get_href}">
                        <vte:value select="{article.get_title}" />
                    </a>
                </li>
            </vte:foreach>
        </ul>
    </vte:template>
</vte:box>

Top rated articles

This example shows on how to create article list which will show five articles with most votes in descending order.

<vte:box module="box_article_list">
    <vte:params>
        <vte:param name="search_sort_by" value="vote_avg" />
        <vte:param name="search_order" value="descending" />
        <vte:param name="search_limit" value="5" />
    </vte:params>
    <vte:template>
        <ul>
            <vte:foreach item = "article" from = "{article_list}">
                <li>
                    <a href="{article.get_href}">
                        <vte:value select="{article.get_title}" />
                    </a>
                </li>
            </vte:foreach>
        </ul>
    </vte:template>
</vte:box>

Headline articles

This example shows on how to create article list which will show five articles that are marked as headlines (“search_status” param with value “2”) in administration.

<vte:box module="box_article_list">
    <vte:params>
        <vte:param name="search_status" value="2" />
        <vte:param name="search_limit" value="5" />
    </vte:params>
    <vte:template>
        <ul>
            <vte:foreach item = "article" from = "{article_list}">
                <li>
                    <a href="{article.get_href}">
                        <vte:value select="{article.get_title}" />
                    </a>
                </li>
            </vte:foreach>
        </ul>
    </vte:template>
</vte:box>

Article list sorted by specific author

This box will pull latest five articles from user with id=1.

Key parameter here is “search_user_id” with value of user id that is “1

<vte:box module="box_article_list">
    <vte:params>
        <vte:param name="search_sort_by" value="created" />
        <vte:param name="search_user_id" value="1" />
	<vte:param name="search_limit" value="5" />
    </vte:params>
    <vte:template>
        <ul>
            <vte:foreach item = "article" from = "{article_list}">
                <li>
                    <a href="{article.get_href}">
                        <vte:value select="{article.get_title}" />
                    </a>
                </li>
            </vte:foreach>
        </ul>
    </vte:template>
</vte:box>

Another example of how can you create article list sorted by specific author is with “search_author” parameter.

Value of that parameter should be whole author name or a part of it.

<vte:box module="box_article_list">
    <vte:params>
	<vte:param name="search_sort_by" value="created" />
        <vte:param name="search_author" value="micha" />
	<vte:param name="search_limit" value="5" />
    </vte:params>
    <vte:template>
        <ul>
            <vte:foreach item = "article" from = "{article_list}">
                <li>
                    <a href="{article.get_href}">
                        <vte:value select="{article.get_title}" />
                    </a>
                </li>
            </vte:foreach>
        </ul>
    </vte:template>
</vte:box>

These are just basic primers for various article lists that you can create within Vivvo.

You can literally go nuts on creating all kinds of article lists using “Search parameters” for box article lists.

Now go be creative blah blah…..

 
devdoc/vte/creating-custom-box-article-list.txt · Last modified: 2008/11/06 06:15 by micha
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki