MODX Community

GetResource does not show the tvLabel content

Hi,
I’ve cannot get the tvLabel using the getResources snippet.
In the tpl I’ve used this code:

        [[!getResources?
          &tpl=`CarDetailsChunk`
          &showHidden=`1`
          &showUnpublished=`1`
          &includeContent=`1`
          &processTVs=`1`
          &includeTVs=`1`
          ]]

And in the chunk I have the such code:

<p>[[+tv.CarGroupClassTV:tvLabel]]</p>

Template variable TV
Has the single value list
Эконом==econom||Комфорт==comfort

But after running the code I received just econom and comfort only values of TV not the Labels.
I am using the MODX Revolution 2.7.1-pl and the latest extra GetResource snippet (1.6.1-pl)

Please any suggestion,
Andy

Is “tv.CarGroupClassTV” the actual name of the TV? The tvLabel filter will only work if it’s passed the actual name of a TV.

Actually “CarGroupClassTV”. But to get the TV values of TV from GetResource they should have prefix “+tv”. So in the chunk I’ve used [[+tv.CarGroupClassTV:tvLabel]]

Should I rename all TV’s to have some prefix and put it to the GetResource as tvPrefix=``?

Just tried that - this is not the decision.
I’ve change the TV CarGroupClassTV to tv.CarGroupClassTV and used it in chunk for the GetResource [[+tv.CarGroupClassTV:tvLabel]] but the value of TV now returns only this code [[+tv.tv.CarGroupClassTV:tvLabel]]

I would suggest going back to the original name and using this property in the getResources tag:

&tvPrefix=``

It’s possible that the output modifier just won’t work when used in a Tpl chunk.

1 Like

Thank you very much @bobray !! This is work as expected!! :smiley:

I’m glad that worked. I wasn’t sure it would. :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.