Hi all, I’ve had this problem before and I’m looking to have some light shed on it and either find a solution or a decent alternative to my problem.
I am working on a site I for a company that has a large number or stockists. Each stockist is an entry that belongs to one of 3 weblogs which are stockists_uk, stockists_europe and stockists_world. Then each entry belongs to a category. Each weblog has its own category group to denote the geographic location.
For example this page is a list of all the sub-categories from the parent category UK from the stockists_uk weblog (attached example of Herfordshire).
There are 5 types of products that each potentially can stock
FABRICS, WALLPAPERS, PAINTS, PAINT POTS, TRIMMINGS & FURNITURE
Some stock fabrics and wallpapers, some only stock furniture etc.
I have set up a number of checkboxes (each a seperate custom field) that my client can ‘tick off’ what the stockist offers. This then via conditionals displays a little icon that shows what they stock. Shown on attachement
This is the code (its the stuff in the <ul> called “offers”)
<ol id="stockistslist">
{exp:weblog:entries weblog="stockists_{segment_3}" paginate="bottom" limit="9"}
<li>
<dl>
<dt>{title}</dt>
<dd>{stockist-address}</dd>
<dd>{stockist-postcode}</dd>
<dd><strong>Tel: </strong>{stockist-phone}</dd>
<dd><strong>Fax: </strong>{stockist-fax}</dd>
<dd><strong>Email: </strong>{stockist-email}</dd>
<dd><strong>Website: </strong>{if stockist-website}<a href="http://{exp:html_strip}{stockist-website}{/exp:html_strip}" title="Visit {title}'s website">Click here</a> {if:else} N/A{/if}</dd>
<dd><strong>Map and Directions: </strong><a href="#">Click here</a></dd>
<dd>
<ul class="offers">
{if stockist-fabric == "Yes"}<li class="fabric-icon">Fabrics</li>{/if}
{if stockist-wallpaper == "Yes"}<li class="wallpaper-icon">Wallpapers</li>{/if}
{if stockist-paint == "Yes"}<li class="paint-icon">Paints</li>{/if}
{if stockist-sample-pots == "Yes"}<li class="sample-icon">Paint Sample Pots</li>{/if}
{if stockist-trimmings == "Yes"}<li class="trimmings-icon">Trimmings</li>{/if}
{if stockist-furniture == "Yes"}<li class="furniture-icon">Furniture</li>{/if}
</ul>
</dd>
</dl>
</li>
{paginate}
<li id="paginateholder"><div class="showpagination showpagination{total_pages}">
Click here to see more results {pagination_links}
</div>
</li>
{/paginate}
{/exp:weblog:entries}
</ol>Now… I need a page that ONLY shows results with the custom field stockist-furniture ticked. The purpose being it specifically displays stockists that stock furniture.
So I assumed I could just use the same
{if stockist-furniture == "Yes"}Around the full list thing like this…
<ol id="stockistslist">
{exp:weblog:entries weblog="stockists_uk|stockists_europe|stockists_world" paginate="bottom" limit="22"}
{if stockist-furniture == "Yes"}
SAME CONTENT IN HERE (Had to remove dude to size of post!!)
{/if}
{/exp:weblog:entries}
</ol>This works aside from the fact it is leaving the results on the same paginated pages they would be on if ALL the entries were present.
See here not exactly 22 per page is there!
Now I’m not too bothered about having the pages paginated as there might not be masses of results but I can’t use a custom entry status as there are some cases where I will need to have pages that only show say… paint stockists AND paint pot stockists. I could use categories but I don’t really want my client to have to not only tick that they supply furniture but then have to select a category as well.
I’ve tried removing the pagination links and disabling pagination but the results are exactly the same just without links to the other pages!
Can someone explain (and hopefully solve!) the reason it is behaving this way?
I just can’t understand why its creating the full number of paginated pages even though the conditional says to ONLY show entries according to its outlined condition.
Please say if you need something clarifying. I’m not sure if this will make any sense to anyone, this has been causing brain ache for a week now!
Thanks