[英]Display the same data in two different places in Modx
I'm new to Modx but already have some experience with chunks and snippets. 我是Modx的新手,但是已经对块和代码片段有一定的经验。 Still, I don't really know the best way to display the same type of resource in two different places in modx. 不过,我真的不知道在modx的两个不同位置显示相同类型资源的最佳方法。
On my site I have "review" resources which I want to have in a slider on main page ( like this ) and on a dedicated reviews page ( like that ) with them being the same resources. 在我的网站上,我希望主页上的滑块( 如 )和专用评论页( 如 )中的“审阅”资源具有相同的资源。
What's the best approach to solving this? 解决此问题的最佳方法是什么? Should I use Extras for this? 我应该为此使用Extras吗?
You want to use the getResources extra, in fact 99.99% of all modx sites you develop will probably use getResources. 您想额外使用getResources ,实际上,您开发的所有modx网站中的99.99%可能会使用getResources。
Basically it allows yo to grab the attributes [content, TVs, title, alias etc] of a given gresource or set of resources [that you can search and filter with the getResources call!] and display them in different types of views by defining a chunk to use as a tpl for your content. 基本上,它可以让您获取给定gresource或资源集的属性[内容,电视,标题,别名等] [您可以使用getResources调用进行搜索和过滤!]并通过定义a在不同类型的视图中显示它们块用作内容的tpl。
I use it for almost every carousel I have ever implemented [in modx] 我几乎在[modx]中实现的所有轮播中都使用了它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.