We are still having some trouble with this. We need to display the daily deals for today from businesses that match the current category. I thought I would take one last shot at seeing if you can help. I have also broken down our objective in case I said something that confused things.
Channel: Daily Deal
- Field: (Playa) Deal-Owner [Applebees on Charles] (selected from the list of entries in the “business-listing” channel)
- Field: Title [Applebees Deal]
- Field: Monday-deal [example: 15% Off Senior Meals]
- Field: Tuesday-deal [example: 10% Off Junior Meals]
- Field: Tuesday-deal [example: 10% Off Junior Meals]
Channel: Business-Listing
- Title [Applebees on Charles]
- City [Denver]
- State [CO]
- Status (options: Super Enhanced, Enhanced, Basic) [Enhanced]
- Categories: Zone [Central]
The daily deal channel has a 1 to 1 playa relationship field which connects the deal to the business. The business listing has all the relevant data about the business (address, etc) The Business is classified to a “Zone” (one of 5 locations) that is used in the URL {segment_1}.
We are attempting to view a Zone home page (segment_1 is populated with the zone name that matches the business category name).
Phonebook.com/central
On the page, only 6 daily deals are listed. The daily deals are comprised of the deal information (corresponds with the day of the week), the business name, the business city and business state.
Example: (assuming you are viewing the page on Monday)
15% Off Senior Meals Applebees on Charles - Denver, CO
Our thinking (as shown in the code below) is: Select the daily deals that have a “Monday” deal. Of those, find the associated businesses and filter to identify only those that coincide with the zone we are viewing. Of the filtered deals/businesses, show the information about the business and the deal information – and show 6 entries on the page.
The code below is what we believe should work (assuming some of it is located in embed files, but have put it all together in hopes that it will make sense).
{exp:channel:entries channel="daily-deals" orderby="random" search:monday-deal="not IS_EMPTY" limit="6"}
{if monday-deal}
{exp:playa:children field="deal-owner" category="{segment_1_category_id}" status="Super Enhanced|Enhanced|Basic"}
{exp:playa:parent channel="daily-deals"}{friday-deal}{/exp:playa:parent}<br>{title} - {city},{state}
{/exp:playa:children}
{/if}
{/exp:channel:entries}
Unfortunately, something is not working. We have tried many variations, but something seems out of line. Either we cannot get the code to limit to 6 entries, or it returns only 3 entries (because the code picks up all deals and limits to 6, but of the 6, it includes those with no deal on Monday (or from different zones).
_________UPDATE_________
Ok - we have made some progress on this question and are using the code below.
Basically we need to filter the PARENT by the CHILD category (which in our case we would like to pull from segment_1 using LowSeg2 addon) Is there a way to filter the parent exp:channel:entries by a child category? {segment_1_category_id}
{exp:channel:entries channel="daily-deals" orderby="random" search:monday-deal="not IS_EMPTY" limit="6"}
<h2>{monday-deal}<br /></h2>
{deal-owner status="Super Enhanced|Enhanced|Basic" disable="members" category="{segment_1_category_id}"}
{if no_children} no kids {/if}
{categories show_group="1"}category_name: {category_name}<br />{/categories}
deal_owner: {title}
{/deal-owner}
{/exp:channel:entries}