We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21106
    • 53 Posts
    Hi, guys.

    I'm currently working on a video sitemap for a website running on ModX Revo 2.2.4-pl. Each video has its own rating (0-100). Each rating is entered on a template variable for each resource.

    My problem stems from the fact that Google doesn't accept percentile rating. So I have to convert the current rating to a 0.00 to 5.00 marking.

    Is there a way to automate this? Like dividing the current percentile rating by 20 before it shows up on the video sitemap.

    By the way, I'm using getResources to create the sitemap with the following call:

    [[!getResources? &parents=`108,2,5,163,39,3,4,6,7,8` &depth=`10` &limit=`1000` &tpl=`videositemap` &hideContainers=`1` &includeTVs=`1` &processTVs=`1`]]


    The TPL (videositemap):
    <url>
    <loc>http://www.domain.com/[[~[[+id]]]]</loc>
    <video:video>
    <video:thumbnail_loc>http://www.domain.com/[[+tv.thumbimage]]</video:thumbnail_loc>
    <video:title>[[+longtitle]]</video:title>
    <video:description>[[+tv.description]]</video:description>
    <video:content_loc>http://www.domain.com/[[+tv.swflocation]]</video:content_loc>
    <video:player_loc allow_embed="yes" autoplay="ap=1">http://get.adobe.com/flashplayer/</video:player_loc>
    <video:view_count>[[+tv.HitsPage]]</video:view_count>
    <video:rating>[[+tv.vidrating]]</video:rating>
    <video:publication_date>[[+publishedon:strtotime:date=`%Y-%m-%d`]]</video:publication_date>
    <video:family_friendly>yes</video:family_friendly>
    <video:uploader info="Uploaderl">Uploader</video:uploader>
    <video:live>no</video:live>
    </video:video>
    </url>


    I would appreciate any insight regarding this.

    Thanks in advance.
      • 37031
      • 93 Posts
      Perhaps you've already looked into it, but could you not use one or a chain of output filters located here:
      http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)

      You may need to create a custom modifier (or snippet)...
        • 4172
        • 5,888 Posts
        Quote from: neil at Oct 27, 2012, 10:37 PM
        Hi, guys.

        I'm currently working on a video sitemap for a website running on ModX Revo 2.2.4-pl. Each video has its own rating (0-100). Each rating is entered on a template variable for each resource.

        My problem stems from the fact that Google doesn't accept percentile rating. So I have to convert the current rating to a 0.00 to 5.00 marking.

        Is there a way to automate this? Like dividing the current percentile rating by 20 before it shows up on the video sitemap.

        By the way, I'm using getResources to create the sitemap with the following call:

        [[!getResources? &parents=`108,2,5,163,39,3,4,6,7,8` &depth=`10` &limit=`1000` &tpl=`videositemap` &hideContainers=`1` &includeTVs=`1` &processTVs=`1`]]



        The TPL (videositemap):
           <url> 
             <loc>http://www.domain.com/[[~[[+id]]]]</loc>
             <video:video>
               <video:thumbnail_loc>http://www.domain.com/[[+tv.thumbimage]]</video:thumbnail_loc> 
               <video:title>[[+longtitle]]</video:title>
               <video:description>[[+tv.description]]</video:description>
               <video:content_loc>http://www.domain.com/[[+tv.swflocation]]</video:content_loc>
               <video:player_loc allow_embed="yes" autoplay="ap=1">http://get.adobe.com/flashplayer/</video:player_loc>
               <video:view_count>[[+tv.HitsPage]]</video:view_count>
               <video:rating>[[+tv.vidrating]]</video:rating> 
               <video:publication_date>[[+publishedon:strtotime:date=`%Y-%m-%d`]]</video:publication_date>
               <video:family_friendly>yes</video:family_friendly>   
               <video:uploader info="Uploaderl">Uploader</video:uploader>
               <video:live>no</video:live>
             </video:video> 
           </url>



        I would appreciate any insight regarding this.

        Thanks in advance.

        try:
         [[+tv.vidrating:div=`5`]]

        [ed. note: Bruno17 last edited this post 13 years, 11 months ago.]
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 21106
          • 53 Posts
          Thanks a lot. This solved it! I just had to divide it by 20 and voila!

          P.S. I didn't know Revo has this. This just blew my mind. I mean, imagine the power of these filters. Thanks for sharing!

          Quote from: Bruno17 at Oct 28, 2012, 01:52 AM
          Quote from: neil at Oct 27, 2012, 10:37 PM
          Hi, guys.

          I'm currently working on a video sitemap for a website running on ModX Revo 2.2.4-pl. Each video has its own rating (0-100). Each rating is entered on a template variable for each resource.

          My problem stems from the fact that Google doesn't accept percentile rating. So I have to convert the current rating to a 0.00 to 5.00 marking.

          Is there a way to automate this? Like dividing the current percentile rating by 20 before it shows up on the video sitemap.

          By the way, I'm using getResources to create the sitemap with the following call:

          [[!getResources? &parents=`108,2,5,163,39,3,4,6,7,8` &depth=`10` &limit=`1000` &tpl=`videositemap` &hideContainers=`1` &includeTVs=`1` &processTVs=`1`]]



          The TPL (videositemap):
             <url> 
               <loc>http://www.domain.com/[[~[[+id]]]]</loc>
               <video:video>
                 <video:thumbnail_loc>http://www.domain.com/[[+tv.thumbimage]]</video:thumbnail_loc> 
                 <video:title>[[+longtitle]]</video:title>
                 <video:description>[[+tv.description]]</video:description>
                 <video:content_loc>http://www.domain.com/[[+tv.swflocation]]</video:content_loc>
                 <video:player_loc allow_embed="yes" autoplay="ap=1">http://get.adobe.com/flashplayer/</video:player_loc>
                 <video:view_count>[[+tv.HitsPage]]</video:view_count>
                 <video:rating>[[+tv.vidrating]]</video:rating> 
                 <video:publication_date>[[+publishedon:strtotime:date=`%Y-%m-%d`]]</video:publication_date>
                 <video:family_friendly>yes</video:family_friendly>   
                 <video:uploader info="Uploaderl">Uploader</video:uploader>
                 <video:live>no</video:live>
               </video:video> 
             </url>



          I would appreciate any insight regarding this.

          Thanks in advance.

          try:
           [[+tv.vidrating:div=`5`]]