Searching Members only section
I have a Knowledge Base section on a site which contents can only be accessed by logged in members.
Can I configure Low Search to only show entries in this (knowledge base) channel and only to logged in members?
Replies
Low 13 Nov 2013 08:13
Short answer: Yes.
How? Depends. Either include the channel or collection in the Form if the member is logged in, or set the parameter in the Results tag if the member is logged in, which would require an early parsed {logged_in_member_id} var, which you can get with Low Variables or Mo' Variables (free).
Nutmeg 13 Nov 2013 08:16
Ok
This is what I currently have: (standard)
{exp:low_search:results query="{segment_2}" status="not closed" disable="categories|member_data"}
{if count == 1}
{if low_search_keywords}You searched for {low_search_keywords}{/if}
and we have found {absolute_results} matches.
{/if}{/exp:low_search:results}
{exp:low_search:results query="{segment_2}" status="not closed" }
{if page_url != ''}
{title}
{if:else}
{title}
{/if}
Found in {low_search_collection_label}.
{low_search_excerpt}
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{if no_results}
Sorry, your query did not return any results.
Check your spelling or try a different search term.
{/if}
{/exp:low_search:results}
Low 13 Nov 2013 08:21
And what's your Form tag look like? You can use http://pastie.org/ or http://pastebin.com/ for large chunks of code.
Nutmeg 14 Nov 2013 19:15
Low 15 Nov 2013 07:21
Looks like you're limiting entries to just the knowledge base collection. If that's the only collection available, why not just hide the entire search form/results tag from non-logged in members?
Nutmeg 5 Jan 2014 03:37
Added collection="" to results tag....