We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37258
    • 34 Posts
    I'm hoping to use the vidLister component to produce video galleries on a site I'm developing.

    Basically everything works as expected, except I can't seem to find a way to separate video content, everything is outputted in a big long list, for example some of his work was produced for the UK market and some for the American, some work is commercial and some is personal and that variety needs to be reflected in the sites structure.

    My question is, is there anyway I can call the snippet so that only videos with certain keywords attached are shown?

    That would solve a lot of problems for me, as I could then start breaking down the list into sections to be shown on seperate pages. It would be even better if the snippet paid attention to youtube playlists, but I understand thats probably out of scope of the snippets capabilities.

    If this can't be done with vidLister, does anyone know of a way I can get youtube videos into the site and control where and when they are shown, I've done quite a lot of searching today but most of the solutions seem to just involve dumping a big list of links into the page which is a bit of a blunt tool AFAIC.
      • 37258
      • 34 Posts
      Well, it definitely doesn't display content by keyword straight out of the box. So I made it do so!

      If anyone else wants to do the same this is how I did it.

      Add the following line in the vidLister snippet under //settings, this is what sets it up to accept an additional input via the snippet call. The value is assigned to a variable at the same time for later use.

      $keywords = $modx->getOption('keywords', $scriptProperties, '');


      then under //criteria replace the line

      $c->andCondition(array('active' => 1));


      with

      $c->where(array('active' => 1));
      $c->andCondition(array('keywords' => $keywords));


      and thats all there is to it! From there simply add a single keyword to each video you want to appear on a given page in the plugins management console and call the snippet like this:

      [[!getPage? &element=`VidLister` &keywords=`KEYWORD`]]


      where KEYWORD would be the keywords you assigned to the videos you want to display.

      jobs jobbed! I can now display a set of videos on a page from the list the plugin pulls in.
        • 40045
        • 534 Posts
        Dont need it right now, but I think its a good addition, maybe you could fork on github and make a pull request with your changes? See here: https://github.com/jkenters/vidLister
          • 43067
          • 15 Posts
          is there any way to filter the video's by things like title/description? I need to feed from a channel that does two types of video i want to grab and occasional videos i don't and if possible I'd like to do it without the need for human intervention.

          sorry if there is an obvious way to do this but I'm still quite new at all this.

          Andy B