[MODx] 4. getResources
1. Create a chunk call 'white_content' for white content:
<!-- Highlights -->
<div class="wrapper style3">
<div class="title">The Endorsements</div>
<div id="highlights" class="container">
<div class="row">
[[!getResources?
&parents=`0` // no parent
&resources=`10,11,9`
&debug=`1`
&tpl=`greyhighlight`
&limit=`3` // 0 -- no limit
&depth=`1`
&includeContent=`1`
&includeTVs=`1`
&processTVs=`1`
&showHidden=`1`
]] </div>
</div>
</div>

When we click the button, we want to open a blog page for each button.
Inside chunk we use get resourece:
parent: -1 means refering to 'resources' tag or you give an id

resources: tell which resources you want to use
depth: means we only look for one level folder.
limit: show 3 result
tpl: chunk
More see:http://rtfm.modx.com/extras/revo/getresources
2. Create greyhighlight chunk:
<div class="4u">
<section class="highlight">
<a href="[[~[[+id]]]]" class="image featured"><img src="[[+tv.highlightImage]]" alt="" /></a>
<h3><a href="#">[[+pagetitle]]</a></h3>
<p>Eget mattis at, laoreet vel amet sed velit aliquam diam ante, dolor aliquet sit amet vulputate mattis amet laoreet lorem.</p>
<ul class="actions">
<li><a href="[[~[[+id]]]]" class="button style1">Learn More</a></li>
</ul>
</section>
</div>
'+' means: under current page, looking for the TV.
3. For each blog page:
For example: set TV

4. View the result.
Once you click the image or button, it will navigate to the blog page.
[MODx] 4. getResources的更多相关文章
- Android重写getResources规避用户调整系统字体大小影响Android屏幕适配
Android屏幕适配一直是一个头疼的问题.除此之外还要考虑APP在实际应用场景中,用户千奇百怪的设置,最常见的用户设置行为就是设置手机的字体大小,比如把字体设置成超大或者超小,这对屏幕适配又带来额外 ...
- Android 非Activity类引用getResources()方法问题的解决方法
在进行Android开发的过程中,在一个非Activity类(此处假设类名为MyNewClass)中引用了getResources()方法,如下: Bitmap bmp = BitmapFactory ...
- [MODX] 2. Chunks $
Chunk in Modx can cut your template into samll pieces to make code reuseable. [[$chunk_name]] For ex ...
- [MODX] 0. Mangement System Overview
In Modex, there are three tabs: Resoources, Elements & Files First: 'Files' is the place where t ...
- [MODx] 1. Add Html5 template into the MODx
1. Connet MODx by SSH: Go to the MODx cloud; Find you current user and right click selet Edit Cloud; ...
- [MODx] 8. Snippet get data, chunk display
Simple Example: Lets process this chunk and output its value. We have this Chunk, called "Welco ...
- [MODx] 7. MIGX DB
MODx provides a really unfriendly way to work with xPDO class. What I means is you need to define XM ...
- [MODx] 5. WayFinder
1. Install the wayFinder package 2. Select the resource which you want to show: The 'published' reso ...
- [MODx] Build a CMP (Custom manager page) using MIGX in MODX 2.3 -- 1
BIG FUCK for MODx MODx document is not that good ... at least in my opint of view. I spend hours t ...
随机推荐
- ZJOI2010网络扩容
无限orz hzwer神牛…… 第一问很简单,按数据建图,然后一遍最大流算法即可. 第二问则需要用最小费用最大流算法,主要是建图,那么可以从第一问的残留网络上继续建图,对残留网络上的每一条边建 ...
- [swustoj 1097] 2014
2014(1097) 问题描述 今年是2014年,所以小明喜欢2014的每一位数字(即:2,0,1,4),小明想知道在区间[l,r](包括l和r)中有多少个数中含有这4个数字(数字无前缀零). 输入 ...
- 使用hibernate tools插件生成POJO
很多时候我们已经设计好了数据库,需要使用hibernate来做数据持久化,因此需要根据数据库中的表结构生成相应的POJO. 本例使用hibernatetools来自动创建pojo. 测试环境:ecli ...
- HDU 5289 Assignment
题意:求一段长度为n的序列里有多少个子区间内的最大值减最小值小于k. 解法:RMQ+尺取法或单调队列.RMQ可以用st或者线段树,尺取法以前貌似YY出来过……只是不知道是这个东西…… 设两个标记l和r ...
- C# 有关文件路径的操作
1. 由文件全路径,获取文件扩展名.文件名等信息 string fullPath = @"\WebSite1\Default.aspx"; string filename = Sy ...
- 浏览器插件 - Chrome 对 UserScript 的声明头(metadata)兼容性一览
1.这里的UserScript指的是,油猴插件或者Tampermonkey插件等支持的格式如下例子: // ==UserScript== // @name // @namespace http://A ...
- 【转】Qt Creator在Windows上的调试器安装与配置
https://www.librehat.com/qt-creator-on-windows-debugger-installation-and-configuration/
- leetcode@ [34] Search for a Range (STL Binary Search)
https://leetcode.com/problems/search-for-a-range/ Given a sorted array of integers, find the startin ...
- iOS--消息推送后方法回调情况(简)
消息推送 工作 --- 消息推送 消息推送 消息推送集成参考友盟 http://dev.umeng.com/push/ios/integration 注意测试环境下,(友盟)设备在手机启动程序的时 ...
- js常用方法:
1.将 "\/Date(1313572554031)\/" 转化为 “yyyy-MM-dd hh:mm:ss”字符串格式: //测试 var str = "\/Date( ...