[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=`-1`
                          &resources=`10,11,9`
                          &debug=`1`
                          &tpl=`greyhighlight`
                          &limit=`3`
                          &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.

时间: 2024-08-12 09:25:22

[MODx] 4. getResources的相关文章

赵雅智_Android的getResources()资源引用

今天做一个Android的刮刮乐项目.里面用到非常多的地方用到了getResources. <span style="font-size:12px;"> // 获得图片 //參数1:res是资源的引用,參数2:id是图片的id after = BitmapFactory.decodeResource(getResources(), R.drawable.b); before = BitmapFactory.decodeResource(getResources(), R.d

[MODx] 8. Snippet get data, chunk display

Simple Example: Lets process this chunk and output its value. We have this Chunk, called "WelcomeChunk": <p>Welcome [[+name]]!</p> We'll put this in our Snippet: $output = $modx->getChunk('WelcomeChunk',array( 'name' => 'John',

[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; Find your SSH connect information: 2. Upload an HTML5 template You can grap one from www.html5up.com Upload the files to the root dir (for learning p

[MODX] 2. Chunks $

Chunk in Modx can cut your template into samll pieces to make code reuseable. [[$chunk_name]] For example we can replace the html header with [[$html_header]], it should work as before.

[MODx] 7. MIGX DB

MODx provides a really unfriendly way to work with xPDO class. What I means is you need to define XML schma, mysql table and run the script to generate other stuff (model and controller), which is really suck... Luckly, MIGX DB could help you finish

[MODx] 5. WayFinder

1. Install the wayFinder package 2. Select the resource which you want to show: The 'published' resources are shown in drak icon, otherwise light color. 3. Use wayfinder: <!-- Nav --> <nav id="nav"> [[Wayfinder? &startId=`0`&

[MODx] 6. Cache &#39;!&#39; with login package

1. Install login package. 2. Create a Template called 'login': [[!Login? &loginResourceId=`13` // means after login, redirect resource 13 page, in our case, redirect to self ]] <h2>Register</h2> [[!Register? &submitVar=`registerbtn` &a

Android --- 读取系统资源函数getResources()小结

转   http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2012/1201/655.html 一.基本介绍 数据包package:android.content.res主要类:ResourcesInputStream openRawResource(int id) 获取资源的数据流,读取资源数据把一个图片资源,添加你的文件到你工程中res/drawable/目录中去,可以在代码或XML布局中,引用它也可以用资源编号,比如你选择一个文件只

[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 to search martirals to find out how to build a CMP by using MIGX in MODX 2.3. The officail doument are written for 2.2, but since 2.3, it changed a lot