Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Conditional Output Field

$
0
0

I'm using the plugin vidembed to allow users to embed video from either a youtube or vimeo url.

I need to create an expression to either display one or the other. (The .png files listed in parentheses refer to screenshots I attached)

I created a radio field to ask the user if they were posting a url from youtube or vimeo.
(radio field.png)

In the radio field I set the youtube value to 1 and the vimeo value to 2.
(radio field.png)

I also set up a conditional display so it displays the meta box for whichever value they select. Youtube field for youtube, and vimeo field for vimeo.
(youtube url field.png)
(vimeo url field.png)

Now I just need to create a views expression to display the field for youtube if the radio field value is 1 and vimeo if the radio field value is 2.
(view template.png)

If I enter both fields without the expression it renders the correct video but it displays a nonworking iframe for the empty url field as well.
(post page.png)

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 20145

Trending Articles