We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38379
    • 2 Posts
    Hi,
    first message here.
    I'm facing an issue in my attempt to parse an external youtube URL ( in a TV ) and extract the video ID from it.
    I've made a TV named YoutubeURL type URL where users can enter the video URL.
    I can call this TV in a template :
     [[*YoutubeURL]]

    works fine and return the full URL with all parameters.
    However when I call a snippet using this TV as a parameter :
     [[!YoutubeID? &url=[[*YoutubeURL]]]]

    with something like that in the snippet :
    <?php
    print $url;
    ?>

    instead of returning the full url as above it returns the url without the parameters :
    http://youtube.com/watch?v=VIDEOID
    become:
    http://youtube.com/watch

    Is there any way for me to pass that url TV to the snippet with all its parameters?
    Thanks in advance for any help provided.
    Best regards,

    Geoff [ed. note: supergeoff last edited this post 14 years, 9 months ago.]
      • 38379
      • 2 Posts
      fixed using a
      $resource = $modx->getObject
      $url = $resource->getTVValue
      
        • 30585
        • 833 Posts
        Hey,

        I think it has something to do with the "?" and "=" characters. It's simply stripping them.

        In your snippet code you should write a rule that isolates these characters so their not processed.

          A MODx Fanatic
          • 30585
          • 833 Posts
          Glad you foxed it.
            A MODx Fanatic