We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I'm working on a Video rating platform. Vowed to use MODx for it, so far so good. I'm working with Revolution 2.2.6 on an Apache development server.

    I have the videos hosted on Vimeo but do not want to use the vimeo API. This is future proof: if vimeo changes the site would not have to be reworked. If vimeo disappears we will loose only the video files (without loosing out video properties, Hit counts, comments, etc)

    I created a resource pay video and have TVs for Artist name, Video Title, Genre and Album cover. I'm using getResources to display a collection of the Videos and have getUrlParam to attach the Vimeo video IDs to the thumbs in display.

    THE INTENTION:
    When a thumbnail is clicked, it takes you to a blank resource that then loads the full video with related videos on the sidebar.

    The black resource only works to hold the Javascript provided by Vimeo for Video integration.

    THE PROBLEM:
    I'm trying to use getRelated to solve the problem. First it didn't display nothing but when I selected a TV value on blank resource, it displayed the related videos but without the TVs needed for each (Artist, Title, Thumb, Video ID). The aim to have the related videos displayed like the initial thumbnail that bings the user to the current page.

    More like the blank resource only retrieves the Video ID (using getUrlParam) and inserts into the Vimeo Javascript.

    It's my first time with getRelated, how do I use it to accomplish since my blank resource holds no real site data, only acting as a loader? Or is there a better approach to what I'm trying to achieve?

    Thank you.

    This question has been answered by BobRay. See the first response.

    [ed. note: ojchris last edited this post 11 years, 2 months ago.]
    • I've been able to get this to work to a degree. I eliminated the use of getUrlParam. The thumbnails now link directly to their respective pages but the related videos section on the sidebar is still not displaying the template variables of the related videos. Seems getRelated does not return TVs. Even with the returnTVs property, TVs are not displayed.

      When I use the resource fields, the current page fields are rather displayed stead of the those of the related fields

      • discuss.answer
        • 3749
        • 24,544 Posts
        Can you paste your getRelated tag and the Tpl chunk?

        It sounds like you are using this in your tplRow chunk:

        [[*fieldName]]


        instead of this:

        [[+fieldName]]


        The first one will always give you the value for the current resource instead of the one retrieved by getRelated.

        Also, make sure you don't prefix the TVs with 'tv.' -- just use their names.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
        • What can I do without BobRay? Your assumptions were right. Now resolved.

          Using this &parents=`19`, I guess the search will be restricted to child resources of the id 19?
            • 3749
            • 24,544 Posts
            That's right. I'm glad you got it sorted. smiley
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting