Sorry for the convoluted question. Let me add some clarity to this:
I have a two channels: products & videos. On the videos channel I have custom field for a YouTube url along with a Playa field to relate the video to a specific product(s). I also tied the same category group the products channel is using to the video channel. I have this setup for two reasons:
- Client can add a video to a category so this video is shown on all products pages with that category
- Client has the option to relate the video to a specific product(s)
I realize I could potentially just use the Playa filter to get the correct entries and do a mass dump but I thought it would be a lot easier to just use a category if the video is a general overview of a certain product category.
How do I structure the conditional to show/hide if a video matches those options?
I'm using the awesome URL Helper addon for segment variables so I can easily do something like this on the single product page:
{exp:channel:entries
category="{segment_2_category_id}"
channel="videos"
disable="category_fields|member_data|pagination|trackbacks"
dynamic="no"
}
show video stuff
{if no_results}no video here{/if}
{/exp:channel:entries}
or use the Playa tag {exp:playa:total_parents}
in a conditional. The problem is I need to check both before displaying the data