We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32678
    • 290 Posts
    I'm migrating a site from Evo to Revo and using getResourceField (in place of getField) in a couple of ways and not getting any output. I've run through the syntax and cannot find errors.

    The target resource is a configuration page (published) nested inside an container (unpublished). This mirrors the configuration on the Evo site. The fields I'm trying to pull in are template variables.

    Here's the code:

    <div id="identity">
                        
                <a class="logo" href="[~[[getResourceField? &id=`10` &field=`logoLink`]]]">[[getResourceField? &id=`10` &field=`siteLogo`]]</a>
                        
                <h1 class="tagline">[[getResourceField? &id=`10` &field=`siteTagline`]]</h1>
                   
            </div> <!--end identity-->
    

    I really hope there isn't something obvious that I'm missing, though I'm sure that's the case!
      • 32678
      • 290 Posts
      Figured it out by adding the &processTV param. I know I had this included previously...pilot I'm sure.
        • 42986
        • 6 Posts
        Quote from: wpicotte at Mar 26, 2012, 09:41 PM
        I'm migrating a site from Evo to Revo and using getResourceField (in place of getField) in a couple of ways and not getting any output. I've run through the syntax and cannot find errors.

        The target resource is a configuration page (published) nested inside an container (unpublished). This mirrors the configuration on the Evo site. The fields I'm trying to pull in are template variables.
        ...
        I really hope there isn't something obvious that I'm missing, though I'm sure that's the case!

        I'm having the same issue migrating from Evo. I want to insert the background image for each page into a JS array for a slider script:

        The old code:
        slides  :[
                            {image:"[!GetField? &docid=`1` &field=`img` !]"},
                            {image:"[!GetField? &docid=`2` &field=`img` !]"},
                            {image:"[!GetField? &docid=`3` &field=`img` !]"},
                            {image:"[!GetField? &docid=`4` &field=`img` !]"},
                            {image:"[!GetField? &docid=`5` &field=`img` !]"},
                            {image:"[!GetField? &docid=`6` &field=`img` !]"},
                            {image:"[!GetField? &docid=`7` &field=`img` !]"}
                          ]          
        


        My experimental Revo version:
        slides  :[
                            {image:"[[!getResourceField? &id=`1` &field=`img` &processTV &default=`assets/images/backgrounds/defaultBG.jpg`]]"}, //returns: Array
                            {image:"[[!getResourceField? &id=`2` &field=`img` &processTV &default=`assets/images/backgrounds/defaultBG.jpg`]]"},// returns assets/images/backgrounds/defaultBG.jpg
                            {image:"[[!getResourceField? &id=`3` &field=`img` &processTV]]"}, //next 5 return ""
                            {image:"[[!getResourceField? &id=`4` &field=`img` &isTv=`1` ]]"},
                            {image:"[[!getResourceField? &id=`5` &field=`img` &isTv=`1` ]]"},
                            {image:"[[!getResourceField? &id=`6` &field=`img` &isTv=`1` ]]"},
                            {image:"[[!getResourceField? &id=`7` &field=`img` &isTv=`1` ]]"}
                          ]        
        //Some other TVs:
                  /*[[getResourceField? &id=`1` &field=`logo` &processTV]]*/ //returns: /*Array*/ 
                  /*[[!getResourceField? &id=`1` &field=`shade` &processTV]]*/ //returns: /*Array*/ 
        


        I've tried configuring the 'img' TV to output as a String the input type is Image.

        Any suggestions? How can I make getResourceField iterate over an array and display the content?

        Or event better, Iterate over children of the current Resource and output img formatted for a JS array:
        [[getResources? &id=[[*child]] &field=`img` &tpl=`{image:"[[+placeholder]]"},`]]
          • 42986
          • 6 Posts
          Yeah, got this working. Stupidly I was editing an inactive duplicate of my template. D'oh!

          The direct port of the code from Evo GetField works like this:
          	slides  :[
                              {image:"[[getResourceField? &id=`1` &field=`img` &processTV=`1` &default=`assets/images/backgrounds/homeBG.jpg`]]"},
                              {image:"[[getResourceField? &id=`2` &field=`img` &processTV=`1` &default=`assets/images/backgrounds/anotherBG.jpg`]]"},
                              {image:"[[getResourceField? &id=`3` &field=`img` &processTV=`1` &default=`assets/images/backgrounds/blackBG.png`]]"},