Filter field mapping

Post

Posted
Rating:
#6692 (In Topic #1733)
Avatar
Standard member
treedood is in the usergroup ‘Fan in action’
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
Online now: No Back to the top

Post

Posted
Rating:
#6695
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
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.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#6697
Avatar
Standard member
treedood is in the usergroup ‘Fan in action’

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.
Online now: No Back to the top

Post

Posted
Rating:
#6698
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
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.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#6699
Avatar
Standard member
treedood is in the usergroup ‘Fan in action’

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:
Online now: No Back to the top

Post

Posted
Rating:
#6804
Avatar
Standard member
treedood is in the usergroup ‘Fan in action’
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...
Online now: No Back to the top

Post

Posted
Rating:
#6807
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
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.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#6808
Avatar
Standard member
treedood is in the usergroup ‘Fan in action’

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…
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

gabriel58, Paul D, John Connor, babu, MVLipwig, Salman, deepu_ms

Forum statistics:
  • 1,361 topics, 5,909 posts, 7,289 members
  • Our newest member is PolicyGaga
Birthdays:
Back to Top