0

I'm trying to display a list of Users based upon the value of a custom field that I am storing dynamicly in a Stash variable.

Basicly, if the Logged in Users Company ID is 1, I want to show a list of other users who also have a company ID of 1. When I place the Stash variable {exp:stash:get name='company_id'} inside of the User Tags It doesn't return results, however, if I hard code it I get what I expect.

Am I missing something with passing dynamic Variables into the User Tags?

My User tags look like this:

{exp:user:users search:company_id="{exp:stash:get name='company_id'}"}
   {if no_results} <p class="lead">Sorry, no sports heroes here!</p>
     <p><a href="" class="btn btn-success btn-sm">Add a User</a></p>
   {/if}
<li>{screen_name} - {company_id} - {email}</li>

{/exp:user:users}

Russ

  • Did you define a Stash variable with the set command, to be retrieved with get? Could be a parse order, priority parameters to define. – Stéphane Jun 29 '19 at 5:08
  • Also, have you tried adding parse="inward" parameter to exp:user:users tag? – Romans-8---31-39 Jun 30 '19 at 1:36
  • Yes, I did try parse="inward" And the variable is "set" and is able to be displayed on the same page outside of the Users Tag. I have actually saved the variable on an earlier page within the user scope for use throughout the session. – R. Kern Jun 30 '19 at 10:38

Your Answer

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

Browse other questions tagged or ask your own question.