Is there an alternative to the fastField extra?

I believe the fastField extra is no longer supported or working.
Does anyone know if there’s an alternative extra that will display field values including TV’s?
Thanks
Janice

If you use pdotools then thats the best way: https://docs.modx.pro/en/components/pdotools/parser#FastField-tags

1 Like

https://docs.modx.pro/en/components/pdotools/snippets/pdofield

If you want TV values without messing with the MODX parser, there’s the ShowTv extra.

.

In addition to the pdotools, I have also used getresourcefield.

But Bobray usually gives great advice, so I know I will look at the ShowTV extra in the near future.

Roy

Thanks a lot everyone, i’ll give all the above a go.
:+1:

getResourceField is more generic, so you’d want it if you need fields other than TV fields. It will be a little slower, though, so ShowTv might be a better choice if all you need are TVs .

I’ve tried all options and can’t seem to get my image tv to display.
Basically I’m using Collections for shop items and i want to take the value of the image tv’s for each product and create a gallery. I wanted to try it this way rather than create something from scratch.
It looks like this:

Shop -

  • Product category -
    • product with image tv
    • product with image tv
  • Product category -
    • product with image tv
    • product with image tv

I have tried the following:
< img src="[[!ShowTv? &tvID=4 &resourceID=[[+parent]] &render=1]]" />
< img src="[[!ShowTv? &tvID=4 &resourceID=14 &render=1]]" />
< img src="[[#14.my_image_tv]]" />

What am i missing?
Thanks

Try this:

 &render=`0`

or make it a text TV instead of an image TV.

By default, image TVs produce the whole <img> tag so adding the tag yourself creates invalid html. If a TV contains an image path, I usually prefer to make it a “text” TV and roll my own tag.

Do a “view source” before changing anything and you should see what I mean.

I’m still having problems but i’m not far off what i want to achieve.
I have a gallery page and want to display on this page product images from child resources that’s using the Collections extra. the product images use a TV called [[*my_image_tv]]
I have two chunks.
[[$galleryGetItems]]

    [[getResources?
        &parents=`6`  //This is the Shop container which then has categories within which are the products
	&tpl=`galleryItem`
	&includeTVs=`1`
	&processTVs=`1`
	&tvPrefix=``
	&limit=`0`
	&showHidden=`1`
	&depth=`2`
]]

and [[$galleryItem]]

< div class=“gallery_product three columns filter [[+pagetitle]]”>
< img class=“img-responsive” src=“[[+my_image_tv]]” alt=“[[+pagetitle]]”>
< /div>

The generated html is as expected apart from there’s no image:

< div class=“gallery_product three columns filter pagetitle”>
< img class=“img-responsive” src=“” alt=“pagetitle”>
< /div>

Any ideas?
Thanks

One explanation is that the children of Resource 6 do not have the TV set, or it’s not attached to their template.

Also, the type of the TV should be textfield, not image.

Well, from my experience with Collections and pdoResources / getResources, I would say that having collections here is irrelevant as it still works on a parent - childs perspective.

I see some problems on your proResources / getResources call (both are identical on their basis):

[[getResources?
	&parents=`6`  //This is the Shop container which then has categories within which are the products
	&tpl=`galleryItem`
	&includeTVs=`1`
	&processTVs=`1`
	&tvPrefix=``
	&limit=`0`
	&showHidden=`1`
	&depth=`2`
]]
  1. You don’t need to use the tvPreffix on your request. By default the templateVar binding preffix is: tv.
  2. the depth will depend on your you have the tree organized. If the resources that have the image TV that you want to retirieve are childs of Resource 6, you can simply omit the depth;
  3. On the &includeTVs remove the 1 by the TV name (lets assume that you named it as GalleryImage), then on your chunk, replace the tv call to be like this:

[[+tv.GalleryImage]]

This should do the trick. This is how it should look in the end:

[[getResources?
	&parents=`6`  //This is the Shop container which then has categories within which are the products
	&tpl=`galleryItem`
	&includeTVs=`GalleryImage`
	&processTVs=`1`
	&limit=`0`
	&showHidden=`1`
	&depth=`2` //Remove this if the resources with images are children of resource 6. Keep if they are grandchilds.
]]

Please note that I am assuming that, like BobRay said, the TV is attached to the template of the childs and properly populated, having input type as image and output type as text.

Good luck and ping here again if you still have problems.
Cheers

J.Nogueira

One quick note: you do need to use the &tvPrefix=`` if your TVs do not have the “tv.” prefix.

FYI, this should really be a separate topic because it has nothing to do with fastField.

@bobray - yes you’re right this has now gone off topic. thanks for your input.
@ jnogueira - thanks for your help.
The issue has now been solved.

1 Like