• I’m using the Toolset collection of plugins to manage my site, and I want to use YouTube Embed in this way:
    [youtube search=”yes”][wpv-post-title output=”sanitize”][/youtube]

    That should create a playlist based on the title of the current post.

    But it doesn’t work.

    Does that mean it’s not possible to use a shortcode to determine the search term?
    Is it just a matter of using do_shortcode on the content within your shortcode?

    Alex

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor David Artiss

    (@dartiss)

    Hi Alex.

    Theoretically, that should work – I coded the plugin in such a way that shortcodes within it should execute.

    Trying running [wpv-post-title output=”sanitize”] by itself – grab the output and then put it between the [youtube] shortcode. Does it work then?

    Can you set up a test page on your site demonstrating the above? I’d like to take a look and see what’s happening.

    Thread Starter AlexGoodall

    (@alexgoodall)

    Hello David

    Thanks for the fast response.

    Here’s a video showing what’s happening. The site isn’t live, so all pages are test pages!

    https://www.loom.com/share/6fb3aaa97115487daf6466ac83a15413

    Alex

    Plugin Contributor David Artiss

    (@dartiss)

    Thanks Alex. Unfortunately, that video gives me limited information that I need to diagnose this, especially as you’ve got some pretty-funky non-standard stuff going on in the back-end, which may have an effect here.

    Can you confirm the following for me?

    1. If you run [wpv-post-title output=”sanitize”] what output do you get?
    2. When you try the original shortcode-within-shortcode (that doesn’t work) and the output displays incorrectly – can you go into the page source and dig out the YouTube code and let me know what’s being embedded?

    Thread Starter AlexGoodall

    (@alexgoodall)

    The output from

    [wpv-post-title output="sanitize"] is
    Daniel Schmachtenberger
    as I show in the last part of the video.

    There’s a lot of code, but I guess this is the most helpful:

    <div class="youtube-embed" itemprop="video" itemscope="" itemtype="https://schema.org/VideoObject">
    	<meta itemprop="url" content="https://www.youtube.com//[wpv-post-title output=" sanitize"]"="">
    	<meta itemprop="embedUrl" content="https://www.youtube.com/embed/[wpv-post-title output=" sanitize"]"="">
    	<meta itemprop="height" content="340">
    	<meta itemprop="width" content="560">
    	<iframe style="border: 0;" class="youtube-player" width="560" height="340" src="https://www.youtube.com/embed?listType=search&list=%5Bwpv-post-title+output%3D%22sanitize%22%5D&modestbranding=1&color=white" allowfullscreen="">.....</iframe>
    </div>
    

    You can view the whole page here.

    view-source:https://tllp.org/person/daniel-schmachtenberger/

    Alex

    Plugin Contributor David Artiss

    (@dartiss)

    Hi Alex,

    I’ve tried recreated the issue on my own side and I’m unable to. Looking at my code it should work, as a I allow other plugins to work when embedded within my own. However, whatever you’re doing in your editor may be changing this behaviour.

    When I next take a look at the plugin I’ll do some further testing to see if there is an issue here, but my quick tests don’t show this to be the case.

    Thread Starter AlexGoodall

    (@alexgoodall)

    OK. Thanks David.

    If I come up with any other conditions, I’ll let you know.

    Alex

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Using a short-code to determine the search term’ is closed to new replies.