2

I have a category select menu that will select a category from the zoo_visitor channel. THis will then load a page with the selected category in segment_3. Problem is the zoo_visitor members are not responding dynamically based on the category selected in segmetn_3

Here is the select menu:

<form name="catmenu" action="">
  <select name="selcat" onchange="location=document.catmenu.selcat.options[document.catmenu.selcat.selectedIndex].value;">
  <option value="">Filter by Riding</option>
    <optgroup label="group 39">
    {exp:channel:categories cache="yes" refresh="60" channel="zoo_visitor" disable="category_fields" style="linear" category_group="39" show_empty="no"}
        <option value="{path='Riding'}">{category_name} </option>
    {/exp:channel:categories}
    </optgroup>
    <optgroup label="group 41">
    {exp:channel:categories cache="yes" refresh="60" channel="zoo_visitor" disable="category_fields" style="linear" category_group="41" show_empty="no"}
        <option value="{path='Riding'}">{category_name} </option>
    {/exp:channel:categories}
    </optgroup>
 </select>
</form>

this displays a url like: http://domain.com/index.php/Riding/category/cat_name

this template has the code:

 {exp:zoo_visitor:members limit="99" member_group="5" orderby="random" dynamic_parameters="orderby|limit|sort|category|member_lastname" status="Members-id5" }
 <h2>{visitor:member_firstname} {visitor:member_lastname}</h2>
      <p>{visitor:member_level_of_government}<br />
      Region: {categories show_group="42"}{category_name}{/categories} </p>
  {/exp:zoo_visitor:members}

Problem is ALL members from group_5 are displayed and not ONLY those have the segment_3 selected

  • What happens if you take out member_group="5" parameter and just use the status to target that member group? – Romans-8---31-39 Jun 5 '13 at 16:56
  • @Romans-8---31-39 : it doesn't change anything if I remove the member_group, all members are displayed – Peter Eastwood Jun 5 '13 at 17:05
  • I just tested it and getting the same results as you. It looks like the default for zv memberlist is disable="categories|category_fields|member_data|pagination". What about using channel:entries instead? – Romans-8---31-39 Jun 5 '13 at 17:47
  • 1
    I did end up using channel entries and that seems to be my best bet so far – Peter Eastwood Jun 5 '13 at 18:29
1

Just came across this post, for anyone else that may be looking for similar answers to this question. I've used this type of code on pages to display member details based on a number of variables with no problems to date. Here's my take:

{if segment_3 == ""}
 <p>no results</p>
{if:else}
{exp:zoo_visitor:details limit="99" url_title="{segment_3}" member_group="5" status="Members-id5}
  <h2>{visitor:member_firstname} {visitor:member_lastname}</h2>
  <p>{visitor:member_level_of_government}<br />
  Region: {categories show_group="42"}{category_name}{/categories} </p>
{/exp:zoo_visitor:details}
{/}if

The form submitted will provide a set of conditional rules that determine the information displayed on the result page. The result page needs to be setup to enable the conditions to be met or otherwise return an error response.

The first IF conditional should provide a response if the segment_3 is empty (which can be a result of a search engine link) and advise the visitor accordingly.

If the segment_3 condition is met with content, the zoo_visitor:details field will then provide a result based on using the url_title of segment_3 and also the group and status of the entries.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.