Composr Supplementary: Updating the Members Listing in Composr

Written by Steve Jarvis and Chris Graham, Sponsored by Arvixe hosting
Image

The member directory with boxes

The member directory with boxes

(Click to enlarge)

Image

The default look of the member directory

The default look of the member directory

(Click to enlarge)

Once your Composr community-based site gets to a certain size you might want to change how your members list is displayed. The standard listing utilises a list style with Username, Primary usergroup, Number of posts and Join date, which can be sorted by which ever data type you prefer. You can see an example of this on the right.

You can install an addon called Member Directory boxes which will change the listing to include the Users avatar too. The most useful element of this addon is the ability to filter the results by Username, Interests which are added to the user's profile, Location, Occupation or by elements written in the users 'about me' section. An example of this can be seen in the image below

Showing boxes

You can edit the CNS_MEMBER_DIRECTORY_SCREEN.tpl template to change the default box style.

To do this, go to Admin Zone > Style > Manage themes > Edit templates and select CNS_MEMBER_DIRECTORY_SCREEN.tpl for editing.

The default template contains:

Code

{$BLOCK,block=main_members,max={$CONFIG_OPTION,members_per_page},sort={$CONFIG_OPTION,md_default_sort_order},display_mode=listing}

To make it show boxes you would edit to:

Code

{$BLOCK,block=main_members,max={$CONFIG_OPTION,members_per_page},sort={$CONFIG_OPTION,md_default_sort_order},display_mode=boxes}

With more advanced editing you can also show filters. All the normal parameters of the main_members block is supported.

If you don't like to write Tempcode, you can: create a test Comcode page, turn off the WYSIWYG editor, use the Block construction assistant to add a main_members block, then add the Comcode produced to the template like:

Code

{$COMCODE,[block display_mode="boxes"]main_members[/block]}
(i.e. using the {$COMCODE,....} symbol to wrap up your regular Comcode)

Changing the layout of the member boxes

Once the addon is installed and you are happy it is working how you would like it to be, you may want to add extra information to the member cards. To change this you will need to edit the templates file which can be found in the templates _custom folder of the default theme or your theme if you've already made changes. The template you will need to edit is CNS_MEMBER_BOX.tpl.

However I strongly recommend that unless you have a very good understanding of programming you don't make changes to the templates as changes here could cause serious issues for your website.

Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.