This is an auto-generated topic for
ListMembersByCategoryInterfacingSnippet 1.0.0-pl by Jul.
Brief Description:
Interfaces with version 1.0 of the ListMembersByCategory PHP class
This snippet interfaces with MODx the ListMembersByCategory proprietary PHP class that let you display records from a MySQL table grouped into categories defined in a second table.
ListMembersByCategory (LMBC) is useful when you're looking for an alternative to Ditto or Wayfinder that does not depend on the document structure.
For example in ecommerce, you can use LMBC to display the categories of products and for each category which products are in it.
To select the categories to list, you can use any field with unique values.
For instance, you can use category names, which are easier to remember than numeric id.
Because the LMBC is independant from MODx and consequently from the document tree, you don't have to build such tree to tell which item belongs to which group.
You can organise and display your contents in a way that does not depend on the document structure.
Each item (member) can belong to several groups (categories).
ListMembersByCategory basically links 3 tables:
- the table that defines categories
- the table that stores data about members
- a "membership" table, that links the identifier of the records in the members/categories tables.
If each member belongs only to one category, the "membership" table is optional.
To format the output we use HTML chunk files and placeholders.
Each table column that you want to display becomes an easy-to-remember placeholders.
Some examples:
1) [+member.title+],[+member.firstname+],[+member.name+]
2) [+member.tire_brand+],[+member.tire_diameter+],[+member.tire_width+],[+member.tire_maxPressure+]
3) ...what you want!
If a category contains many members, they can be split in groups of equal length by setting the splitIn parameter.
For instance, if your category contains 60 members, and splitIn=`3`,
[+lmbc.category.members_group1+] would display member records 1 to 20
[+lmbc.category.members_group2+] would display member records 21 to 40
[+lmbc.category.members_group3+] would display member records 41 to 60
ListMembersByCategory supports many parameters.
The detailed documentation with annotated example is available in several languages:
- English:[a title="www.altipoint.ch/list_members_by_category" href="
http://www.altipoint.ch/list_members_by_category" target="_blank]www.altipoint.ch/list_members_by_category[/url]
- French:[a title="www.altipoint.ch/lister_membres_par_categorie" href="
http://www.altipoint.ch/lister_membres_par_categorie" target="_blank]www.altipoint.ch/lister_membres_par_categorie[/url]