[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 ...
随机推荐
- less 能加快css编写?
真心不知道用了less之后,怎么能让css写的更快.有时你定义了变量还得回到开头去看看.关键是定义的变量在css不停的修改中会变得没什么用. 用了之后没觉得会加快,感觉让我更加郁闷,求各位大神指点指点 ...
- Android使用Webview加载网页
安卓使用Webview来加载和显示网页内容,首先在layout文件中定义Webview <?xml version="1.0" encoding="utf-8&qu ...
- OK335xS EMMC Partition hacking
#! /bin/sh # # OK335xS EMMC Partition hacking # 说明: # 本文主要是为了解读同事对EMMC分区的写法,其中有很多写法重复了,但 # 依然尽量保留其作者 ...
- Spring编程风格
给自己使用的无需定义接口:即一个模块内部的都是封装的,定义接口并不会得到很多好处,变过几次实现?? “优先面向接口编程,而非实现” 不是必须,是优先: 给朋友(第三方)使用的定义接口:即要公开的功能, ...
- 为枚举类型添加说明 zt
enum Orientation { [DescriptionAttribute("东")] East, [DescriptionAttribute("南")] ...
- 反编译c#的相关问题
最近硬盘坏掉了,有一个项目没有备份,只好用Exe 文件反编译出来用,查了一下相关的文章用到的工具如下: ILSpy_Master_2.1.0.1603_RTW_Binaries 直接生成时,有些奇怪, ...
- 点亮一个led
1:RS232电平:计算机串口 高电平为-12v,低电平为+12v,所以计算机与单片机进行通信的时候需要加电平转换芯片max232(高电平为-9到-12,低电平为+3到+12之间的. max232通常 ...
- TCP/IP 子网掩码浅析
定义 是一种用来指明一个IP地址的哪些位标识的是主机所在的子网以及哪些位标识的是主机的位掩码.子网掩码不能单独存在,它必须结合IP地址一起使用.子网掩码只有一个作用,就是将某个IP地址划分成网络地址和 ...
- bzoj 1095 [ZJOI2007]Hide 捉迷藏(括号序列+线段树)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1095 [题意] 给定一棵树,树上颜色或白或黑而且可以更改,多个询问求最远黑点之间的距离 ...
- 微软CEO私享会——广东天使会专场圆满落幕
http://www.cnblogs.com/sennly/p/4140976.html 10月17日,微软中国联合广东天使会首期“微软CEO 私享会”在中国微软广东分公司广州太古汇办公室举 ...