This is what I am trying to do:
Make certain entries appear when a certain member group is logged in. If an entry has a value for the “retailers_price” field, that entry will appear when a “Retailer” (member group 6) is logged in.
The code below works to cause the proper entries to appear. But…there are empty pages in the pagination links that correspond to where the entries would be that do not have a value for the “retailers_price” channel field.
To illustrate:
Currently, there are 12 pages of a certain category of entries that are visible to anyone visiting the website. However, there should only be about 3 or 4 pages appearing with entries that have a value for the “retailers_price” field. But, even when a “Retailer” is logged in, all 12 pages appear in pagination, though only a few contain entries.
How can I eliminate those blank links from the pagination?
Here is the code I am using:
{if member_group == "6"}
{exp:channel:entries channel="products" limit="10" status="open|featured" paginate="both"}
{if "{retailers_price}"}
{paginate}
Page {current_page} of {total_pages} <span class="paginate_pipe">| </span> {pagination_links}
{/paginate}
<ul>
<li>
<div class="product">
[PRODUCT FIELDS ARE HERE]
</div>
</li>
</ul>
{paginate}
Page {current_page} of {total_pages} <span class="paginate_pipe">| </span> {pagination_links}
{/paginate}
{/if}
{/exp:channel:entries}
{/if}