BP Profile Search › bps_directory: empty when using template
-
AuthorPost
-
Ace Suares
GuestHi,
[bps_directory template=’members/bps-sidebar’] will not show any members.[bps_directory field_2=’English’] will not add the hidden filter and displayh all members.
andrea
Plugin AuthorHello Ace,
Please make sure you set DEBUG true in wp-config.php so you can see any errors.
Which type is your field 2? Is it a Checkboxes or Multi Select Box type?
If you wish to share your site privately, you can use my Contact page. The messages you post there are only visible to you.
Ace Suares
GuestHi Andrea,
the field is Checkboxes
Ace Suares
GuestNotice: Undefined offset: 0 in /usr/share/wordpress/wp-content/plugins/bp-profile-search/bps-templates48.php on line 5
Notice: Undefined offset: 1 in /usr/share/wordpress/wp-content/plugins/bp-profile-search/bps-templates48.php on line 5
Notice: Undefined offset: 0 in /usr/share/wordpress/wp-content/plugins/bp-profile-search/bps-templates48.php on line 21
Notice: Trying to get property ‘link’ of non-object in /usr/share/wordpress/wp-content/plugins/bp-profile-search/bps-templates48.php on line 21
Ace Suares
GuestIt does work in /people/type/hrm/
If I use the custom templatge, works just fine.But if I use it with bps_directory, without custom template I get all members, and with custom template I don’t get any members and the error you see above
andrea
Plugin AuthorHi Ace,
For Checkboxes fields, the shortcode is:
[bps_directory field_2_match_any="value1,value2,..,valueN"]or
[bps_directory field_2_match_all="value1,value2,..,valueN"]If you are searching for a single value, using match_any or match_all gives the same results:
[bps_directory field_2_match_any="English"]About the template, I’m not able to reproduce the issue. May I see your site?
Ace Suares
GuestThis works!
Thanks!
Is there also some parameter that can select on member_type? On the HRM page I want only type=hrm members just like on /people/type/hrm
Unfortunately I can’t show you this intranet 🙁
I can make screenshots if you want.Ace Suares
GuestRegarding templates…
1. make exact copy of /plugins/bp-profile-search/templates/members/bps-form-default.php and place it in Child-Theme/buddypress/members/bps-sidebar.php
2. Put this in functions php:
<?php
add_filter (‘bps_templates’, ‘add_template’);
function add_template ($templates)
{
$templates[] = ‘members/bps-sidebar’;
return $templates;
}
?>3. put [bps_direcotry] some in a page called HRM
4. make a new form called Test, add one field (the language checkboxes field). In options, choose the new sidebar template, exact copy of the default-form. Choose add to directory. Choose People-HRM for the page, this is the page autogenerated for member-type=hrm.
5. this works. It is using the sidebar.php template and only hrm members are shown, and the language form is there and you can choose a language and see the result on that same page. Cool!
6. now chage the Test form, and choose HRM from the dropdown list instead of Peope-HRM. THis ‘HRM’ page is the page where [bps_diretory] is.
7. On that page, ALL MEMBERS are shown, and the language form is shown, and the results go to that page. Cool!
8. now in that page, change [bps_directory] to [bps_directory template=”members/bps-sidebar”]. It will show the search box and even the language form, but NO members are selected. Completely empty.
Is that reproducable for you??? Also, you can delete the form Test, it will work the same.
andrea
Plugin AuthorIf the member type is the BuddyPress member type:
[bps_directory bp_member_type="Employee"]I’m going to take a look at the template issue now…
Ace Suares
GuestThanks! The bp_member_type works great!
andrea
Plugin AuthorHello Ace,
In step 8, you are using a ‘form’ template where a ‘directory’ template is expected, that’s why it can’t work.
What’s the final result you are trying to achieve?
Ace Suares
GuestThanks for the answer! I guess I need to read instructions better.
THe final result is to remove the ‘all memmber’ tab and the search box, and the order dropdown, to just show a list of members for that department.
Is there an easy way ? 🙂
Thanks for all the help.
andrea
Plugin AuthorTo create your directory template, you can follow sections E and F in Custom Directories.
In your case you’ll need to remove the search box and the Order By drop-down, don’t remove the members tab instead because that’s where the search results will be displayed.
Ace Suares
GuestThanks! It’s working now. I removed almost everyhthing except the members list and the bottom pagination.
andrea
Plugin AuthorGreat, I’m glad I was able to help!
-
AuthorPost