Home
The Toolkit for Online Communities
17704 Community Members, 0 members online, 3823 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Development : listbuilder: export url-vars for orderby/filters? : One Message

Forum OpenACS Development: Re: listbuilder: export url-vars for orderby/filters?

Collapse
Posted by Barry Books on
To add variables to the url add
        -filters {
                counter_id {} # your variables here
        }
to your list::create code
If i create the filter whit
template::list::filter::create -list_name list \ -filter_name filter_name -spec { } . Help ME!!!!!
Collapse
Posted by Jim Lynch on
Have you looked at http://your.server/doc/acs-templating/demo where you will find a few examples with code?

Also, you haven't actually asked a question yet so I have no idea what you want.

-Jim

Collapse
Posted by Brian Fenton on
Hi Alexander

first of all, you probably don't want to call template::list::filter::create directly. Instead you should have a template::list::create with a -filters e.g

set filter ""
append filter { parameter_super_scheme_id {
                  where_clause_eval {
                    set where {and 1 = 1}
                    if { $parameter_super_scheme_id != 0 } {
                      set where "and abc.super_category_id = :parameter_super_scheme_id "
                    }
                    set where
                  }
                }
}
append filter { parameter_scheme_id {
                  where_clause_eval {
                    set where {1 = 1}
                    if { $parameter_scheme_id != 0 } {
                      set where " abc.category_id = :parameter_scheme_id "
                    }
                    set where
                  }
                }

template::list::create \
  -name $list_name \
  -multirow tickets \
  -elements $elements_list \
  -orderby $orderby_list \
  -groupby $groupby_list \
  -filters $filter

You have to pass in to ad_page_contract your filter parameters (parameter_super_scheme_id and parameter_scheme_id in my case). And finally, remember to add [template::list::filter_where_clauses -name $list_name] to the end of your SQL statement that you use to build the multirow.