I have a restricted site, where users have to login to see any content. The content they are shown is restricted by their member id.
To do this, each entry is assigned to a specific member. I'm using 'VMG Chosen Member' to make this easier in the CP.
Showing the relevant entries is working fine and I'm using the following:
{exp:channel:entries channel="fsr" disable="categories|trackbacks" dynamic="off" orderby="fsr-datefield" sort="desc"}
{if logged_in_member_id == fsr-customer}
<tr>
<td>{title}</td>
<td>{fsr-datefield format="%Y-%m-%d"}</td>
<td>{fsr-system-name}</td>
<td>{fsr-call-type}</td>
<td><a href="{fsr-pdf}" class="btn" target="_blank">Download PDF</a></td>
</tr>
{/if}
{/exp:channel:entries}
I want to apply the same limitations to search/results but when I do, it returns the correct results but if there are no results for that member but there are for other members then I get blank content and cannot redirect to the 'no results' template.
Here's my search results code:
{exp:search:search_results}
{if logged_in_member_id == fsr-customer}
<tr>
<td>{title}</td>
<td>{fsr-datefield format="%Y-%m-%d"}</td>
<td>{fsr-system-name}</td>
<td>{fsr-call-type}</td>
<td><a href="{fsr-pdf}" class="btn" target="_blank">Download PDF</a></td>
</tr>
{/if}
{/exp:search:search_results}
I'd ideally just restrict the search or search results by member id, but that does't appear to be possible?
Does this even make any sense?!
Any other ideas? I'm really rusty with EE btw, so please be gentle :)