Does anyone know if it possible to filter the simple search form results according to the channels assigned to the logged_in member?
In other words, can I set the channel parameter automatically to those channels assigned to the logged_in member ?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
September 13, 2011 4:00pm
Subscribe [5]#1 / Sep 13, 2011 4:00pm
Does anyone know if it possible to filter the simple search form results according to the channels assigned to the logged_in member?
In other words, can I set the channel parameter automatically to those channels assigned to the logged_in member ?
#2 / Sep 13, 2011 4:16pm
Does anyone know if it possible to filter the simple search form results according to the channels assigned to the logged_in member?
In other words, can I set the channel parameter automatically to those channels assigned to the logged_in member ?
I would also like to know if this is possible. If it isn’t, it would be nice if it were. 😊
#3 / Sep 14, 2011 3:11am
Hi Jules,
To confirm. You have private channels for logged in members?
You could use conditionals around your simple search form. Would that work for you?
{if logged_in}
{exp:search:simple_form channel="news|blog|private-channel"}
<label for="keywords">Search:</label>
<input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" /></p>
<input type="submit" value="submit" class="submit" /></p>
{/exp:search:simple_form}
{/if}
{if logged_out}
{exp:search:simple_form channel="news"}
<label for="keywords">Search:</label>
<input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" /></p>
<input type="submit" value="submit" class="submit" /></p>
{/exp:search:simple_form}
{/if}#4 / Sep 14, 2011 6:53am
Hi John Henry,
I have several different member groups, each with a different set of channels. So I would have to use a much longer list of conditionals using the “group_id” variable.
Also, though I mentioned only the search form, I would like to be able to do something similar with other tags, such as the channel and comment entry tags.
#5 / Sep 14, 2011 11:16am
EE really doesn’t work that way - you can map member groups to templates on the front end, or member groups to channels (for the purposes of managing content) on the backend, but there’s nothing that lets you directly map member groups to the EE tagset or channels on the front-end.
The only real way to handle it is conditionals like John Henry suggested or member-group specific templates that have the necessary code in them.
#6 / Sep 14, 2011 11:21am
Hi Jules / @nnette,
There is no built-in way of doing this however you could use a sequel query to get what you need here or perhaps create a plugin to also do the same.
I’m going to move this post down to the Community Help forums for additional input on this from other users however if you’d like to put in a Feature Request for something along these lines then you are more than welcome to do so.
Thanks,
Mark
#7 / Sep 14, 2011 1:04pm
Thank you all. I think I’ll just try to use conditionals then.
Just in case any one else wants to jump in, however, I’ll be a bit more concrete about what I am trying to achieve:
- A discussion site with several different feeds: 1) visible to the public, 2) visible to members only, and 3) visible only for the inner circle.
- So, the public sees only 1 and cannot comment on anything.
- Members see 1, and can comment on it. They see and can contribute to 2, and also comment on it.
- The inner circle, can contribute to and comment on all three. The 3rd fees is their private discussion area.