Quote from: wpicotte at Mar 26, 2012, 09:41 PMI'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]]"},`]]