[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 ...
随机推荐
- jQuery修改操作css属性实现方法
在jquery中我们要动态的修改css属性我们只要使用css()方法就可以实现了,下面我来给各位同学详细介绍介绍. css()方法在使用上具有多样性,我们先来了解css()方法基本知识. css() ...
- UVA 10510 Cactus
题意:给出一个有向图,问是不是仙人掌图.仙人掌图:每个边只在一个普通环内的强连通图. 解法:tarjan判断强连通分量是否为1个,记录找环的路径,在每找到一个环时遍历路径记录点出现的次数,如果出现有点 ...
- SSL 通信原理及Tomcat SSL 配置
SSL 通信原理及Tomcat SSL 双向配置 目录1 参考资料 .................................................................. ...
- openvpn文本验证模式配置
证书模式要为每个客户端生成一个证书,虽说安全性较好,但是比较麻烦,可以配置成用户名/密码的验证模式,这样就比较方便了,我这里用最简单的文本验证模式. 一.安装openvpn 不多说了,之前有篇文章已经 ...
- 怎么限制Google自动调整字体大小
Google默认的字体大小是12px,当样式表中font-size<12px时,或者没有明确指定字体大小,则在chrome浏览器里字体显示是12px. 最近在写代码玩的时候,我也碰到了 在FF和 ...
- python join和split和strip用法
python join 和 split方法的使用,join用来连接字符串,split恰好相反,拆分字符串的. strip()为去除开头结尾指定的字符,空着时是去除空白字符\t,\n,\r意思 1.jo ...
- NOIP2011 铺地毯
1铺地毯 题目描述 为了准备一个独特的颁奖典礼,组织者在会场的一片矩形区域(可看做是平面直角坐标系的第一象限)铺上一些矩形地毯.一共有 n 张地毯,编号从 1 到n .现在将这些地毯按照编号从小到大的 ...
- 析构函数释放内存时出现_BLOCK_TYPE_IS_VALID错误
错误信息截图: 原因: 1.内存泄漏:所以当程序退出时,系统会收回分配的内存,于是调析构函数,由于内存已被错误地释放,于是就会出现"Debug Assertion Failed"的 ...
- Spark常用RDD操作总结
aggregate 函数原型:aggregate(zeroValue, seqOp, combOp) seqOp相当于Map combOp相当于Reduce zeroValue是seqOp每一个par ...
- [读书笔记]了不起的node.js(二)
这周做项目做得比较散(应该说一直都是这样),总结就依据不同情境双开吧-这篇记录的是关于node的学习总结,而下一篇是做项目学到的web前端的知识. 1.HTTP篇 node的HTTP模块在第一篇时接触 ...