Filter field mapping

Post

Posted
Rating:
#5995 (In Topic #1242)
I've been looking at the main_members block to create an alterate members table.  I've not been able to figure out the filters options.  For example, I'd like to be able to filter by state.  I know that the state information is in field_32 of the _f_member_custom_fields table.  So how do I get that set up in the Filters row box to enable that search at the top of the directory display?

Thanks….

field_mapping.PNG

Post

Posted
Rating:
#5998
Yikes, that field help is far from clear.
I'll clean it up.

Here's an example I just tested:
m_username=Their Username,Interests=Their Interests

Comma-separated lists of something=somethingElse. Where something is either a f_members column name or the title of your CPF, and somethingElse is just the label you want on the filter.

Post

Posted
Rating:
#6000

Chris Graham said

Here's an example I just tested:
m_username=Their Username,Interests=Their Interests

Comma-separated lists of something=somethingElse. Where something is either a f_members column name or the title of your CPF, and somethingElse is just the label you want on the filter.
Yes, I can see where your example above works but I tried all of these:

State=State
Address: State=State
cms_state=State
field_32=State

and all returned: Unknown field xxxx. Skipping filter for this field.

Post

Posted
Rating:
#6001
This should work:
32=State

Sorry this is a tricky case. field_32 should have worked but there's a bug. In the ideal world "Address: State" would also have worked except the colon messes up the Filtercode syntax being used internally.

Post

Posted
Rating:
#6002

Chris Graham said

This should work:
32=State

Sorry this is a tricky case. field_32 should have worked but there's a bug. In the ideal world "Address: State" would also have worked except the colon messes up the Filtercode syntax being used internally.

Perfect!  Does the job…. :thumbs:

Post

Posted
Rating:
#6091
Followup question to this.  Turns out that it would be better for me to edit the CNS_MEMBER_DIRECTORY_SCREEN.tpl file to accomplish this rather than having an second directory page using the main_members block.  According to the tutorial "Updating the Members Listing in Composr" when editing the template, "…you can also show filters. All the normal parameters of the main_members block is supported."

I currently have this filters_row_a="36=Last name (at HHS),m_username=Username,usergroup=Usergroup" in the main_members block and it works great.  I've not been able to figure out the syntax for accomplishing the same thing via editing the CNS_MEMBER_DIRECTORY_SCREEN.tpl file. Suggestions appreciated.

Thanks...

Post

Posted
Rating:
#6093
Try:
{$BLOCK,block=main_members,block_id=md,max={$CONFIG_OPTION,members_per_page},sort={$CONFIG_OPTION,md_default_sort_order},display_mode=listing,filters_row_a=36=Last name (at HHS)\,m_username=Username\,usergroup=Usergroup}

Or you can do…

Code

{$COMCODE,your regular block Comcode goes here}

The latter isn't ideal though as it has to load up the Comcode parser on every page view.

Post

Posted
Rating:
#6094

Chris Graham said

Try:
{$BLOCK,block=main_members,block_id=md,max={$CONFIG_OPTION,members_per_page},sort={$CONFIG_OPTION,md_default_sort_order},display_mode=listing,filters_row_a=36=Last name (at HHS)\,m_username=Username\,usergroup=Usergroup}

Or you can do…

Code

{$COMCODE,your regular block Comcode goes here}
The latter isn't ideal though as it has to load up the Comcode parser on every page view.
Perfect….I figured it needed some kind of escape sequence but couldn't figure it out.  Works great.  Thanks…
3 guests and 0 members have recently viewed this.