Hi all,
I wonder if this is possible.
I have a blog with >300 entries
In many blogs there is a embedded video-link with it’s own custom_field (channel video by devdemon)
But not all entries do have a video.
I want to show at random 1 video in the sidebar of my blog, with a link to the entry.
It’s normal behavior that the code I use will only show a video if the randomly chosen entry does have the custom_field video.
What I’m looking for is the code that says:
Choose at random an entry. If custom_field_video is not empty: show video.
If else, go to next randomly chosen entry and check if cf_video is not empty. Repeat until the first entry with video is found. Show cf_video. Stop looking.
This code will only show a video if I’m lucky…:-)
{exp:channel:entries channel="blog" dynamic="off" orderby="random" limit="1"}
{if cf_video}
{video:embed_code}
{/if}
{/exp:channel:entries}May be there is some php-coding needed, but that’s not my core-business…
Thanks in advance for thinking with me…