thanks sharkbait,
i tried several fields including pagetitle, longtitle, alias and even id to get something to come up. But it’s dead in the water.
I just downloaded GetField today so i presume it’s the latest version. I also have YAMS and PHx installed. Not sure it that makes a difference.
Did you see GetField work under MODx 1.0.1?
That did it.
Thanks Sharkbait, stay safe.
@outre99
If you are using YAMS then you can use:
[[YAMS? &get=`data` &from=`pagetitle` &docid=`80`]]
to grab the pagetitle from a multilingual document. This will display the pagetitle in the correct language. GetField will just grab the standard document variable - which is redundant for multilingual documents when using YAMS.
Thanks PMS,
i was using the pagetitle just to test GetField. The actual TV is an image and it’s the same for all languages, so no reason to use YAMS for it.
Thanks Sharkbait. That extra space was the problem. Gotta be more careful.
Hi again @outre99
In that case, here is a YAMS placeholder alternative to GetField that you might want to try:
((yams_data:docId:tvname))
This will grab the content of the template variable ’tvname’ from document ’docId’. It may be slightly more efficient than GetField because 1) YAMS doesn’t need to parse and run the GetField snippet and 2) YAMS keeps track of all the data it needs to get from the database and minimises the number of mysql calls required to do so. Therefore, using this construct is likely to reduce the number of mysql calls required (probably by 1). Note that YAMS uses this placeholder internally for obtaining the data required by Wayfinder and Ditto in an efficient manner.
This is brilliant. Thanks again PMS.
I was wondering if something like that was available but didn’t see it in the documentation.
I’m loving Yams more and more.
How can I
getField snippet download ??
http://modxcms.com/extras/package/?package=173
here see i nothing download link
??