-
☆ A M B ☆
- 476 Posts
I'm using MODX Revo 2.2.7.
I'm setting up pages where T.V. values from another MODX Resource is being called on different pages throughout the site. Is the best way to do this with getResources like this:
[[getResources? &resources=`105` &includeTVs=`1` &limit=`1` &tpl=`tv-value`]]
Just wondering if there's a more stripped down MODX plugin or snippet that's faster and leaner. GetResources is a powerful, but I'm wondering if it's overkill for this situation. This site is a rebuild from a site that was built on Silverstripe and it's slow, so I'm looking for best methods while rebuilding on MODX.
[ed. note: flinx777 last edited this post 13 years, 5 months ago.]
Precision Web Development ... SmashStack.com
-
☆ A M B ☆
- 476 Posts
Quote from: jgrant at Apr 26, 2013, 04:48 PMYou might take a look at my extra setPlaceholders. It offers a lot more features that getResourceField and I've written it to be as fast as I know how to make it. It does some caching so you're getting multiple fields from the same resource or the same TV from multiple resources, it'll be faster than getResourceField, not to mention you can do it all in one snippet call and have the results available throughout the template as placeholders, instead of having a bunch of [[getResourceField? ]] calls scattered all around.
That's a good point. I'll have multiple calls on the same page pulling from the other page, so I'd hate to have multiple "getResourceField" calls everywhere. Will look into that. Thanks!
Precision Web Development ... SmashStack.com
Sounds good. setPlaceholders is definitely worth the try. I'll play with it myself when I get time.
A MODx Fanatic
-
☆ A M B ☆
- 894 Posts
From the sound of it it looks like your trying to setup a resource as a settings page probably, if that is the case I suggest you use ContextSettings or have a look at Marks
ClientConfig extra.
I also started working on something similar so you can have clients edit these settings via a resource on the front end which you can style however you want you can check it out in my
gitHub repo.
Good Luck.
I agree too, but if you really need a TV from another page, here's another method:
http://bobsguides.com/showtv-tutorial.html. It should be a little faster than getResourceField and *way* faster than using getResources.