category::list::elements (public)

 category::list::elements [ -categories_column categories_column ] \
    [ -tree_ids tree_ids ] [ -locale locale ] [ -one_category_list ] \
    -name name [ spec ]

Defined in packages/categories/tcl/category-list-procs.tcl

Adds list-elements to display mapped categories. To be used in list::create.

Scenario:
you prepare a multirow which is then displated via template::list::create

Usage:
you change the list query by adding an outer join to category_object_map and selecting the object_id and the category_id. After having built the multirow holding the list of objects you add a call to

    category::list::collapse_multirow -object_column <<columnname-holding-object_id>> -name <<multirowname>>
to collapse the multirow so that it holds only one row per object with a tcl-list of mapped categories in the category column.

After you got the multirow, use

    category::list::prepare_display -name <<multirowname>> -container_object_id $package_id
(or an object other than package_id that the trees are mapped to). This proc will generate one extra multirow column per mapped tree that will hold a pretty list of the categories. The pretty list can be changed with various options (delimiter, links etc). If you want to have only one extra multirow column holding a pretty list of the mapped trees and categories, then you should use the -one_category_list option.

To automatically generate the appropriate input to be used in the elements section of template::list::create, use

    category::list::elements -name <<multirowname>>
followed by extra spec to be used per element. Again, to display only one column use the -one_category_list option.

Switches:
-categories_column (optional, defaults to "categories")
beginning of the names of the multirow columns holding the category-names.
-tree_ids (optional)
trees to be displayed. if not provided all tree columns in the multirow will be displayed.
-locale (optional)
locale to display the tree-names in columns.
-one_category_list (optional, boolean)
switch to generate only one additional column in the list that holds a pretty list of tree-names and category-names.
-name (required)
name of the multirow for the list.
Parameters:
spec (optional)
extra spec used for the list-elements. you can override the display_template with using "categories" as column holding the pretty list of category-names.
Author:
Timo Hentschel <timo@timohentschel.de>
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 category_tree::get_name category_tree::get_name (public) template::multirow template::multirow (public) category::list::elements category::list::elements category::list::elements->category_tree::get_name category::list::elements->template::multirow

Testcases:
No testcase defined.
[ show source ]
Show another procedure: