1. Add chunk:


For example, replace the header by using chunk.

Usage: [[$chunk_name]]

  • Cut all the header code from the Learn template
<!DOCTYPE HTML>
<!--
Escape Velocity by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>[[++site_name]] - [[*pagetitle]]</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<script src="js/jquery.min.js"></script>
<script src="js/jquery.dropotron.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
</noscript>
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>
  • create a new chunk called 'learn_header' and parse the content in.
  • Inside the Learn Template, put [[$learn_header]] as a placeholder.

2. Create a 'Template Variable':


Usage: [[*tv_name]]

  • Click to new template variable called 'favorText'

  • Input type as 'RichText'

  • Template Access assign to 'Learn Template'

  • Then save it
  • Go to the Resource tab, 'Learn' Document, you will see there is a new tab call tempalte variable

  • You will see a rich text inside template variable, can write some text into it

  • We wil replace the text on the web page by this 'TV', so first add template variable into the 'learn template'
        <!-- Intro -->
<div id="intro-wrapper" class="wrapper style1">
<div class="title">The Introduction</div>
<section id="intro" class="container">
<p class="style1">[[*favorText]]</p>
<p class="style2">
  • View the page to see the change

3. Down to the Category:


You can notice that, in the template variable, it show uncategorized:

You can decide the category which you want, here, we divid the page according to the different part of color.

Therefore, 1. Black, 2. Saimon, 3. White:

  • Create those three categories

  • Edit 'favorText', select category as 'Saimon', index as '2'
  • Copy favorText as 'titletag', set index as '1', input type as 'Text'

  • Inside the 'Learn Template',  add 'titleTag' into it.
        <!-- Intro -->
<div id="intro-wrapper" class="wrapper style1">
<div class="title">[[*titleTag]]</div>
<section id="intro" class="container">
<p class="style1">[[*favorText]]</p>
<p class="style2">
  • In the 'learn' document, template variable, add value to the titleTag

  • See the result

[MODx] 3. Working with chunks, TV, Category的更多相关文章

  1. Scrapy-redis 安装配置使用

    # 安装redis服务器端 sudo apt-get install redis-server # 安装scrapy和scrapy-redis库 pip install scrapy pip inst ...

  2. 基于Node.js的爬虫工具 – Node Crawler

    Node Crawler的目标是成为最好的node.js爬虫工具,目前已经停止维护. 我们来抓取光合新知博客tech栏目中的文章信息.访问http://dev.guanghe.tv/category/ ...

  3. [MODX] 2. Chunks $

    Chunk in Modx can cut your template into samll pieces to make code reuseable. [[$chunk_name]] For ex ...

  4. Android为TV端助力 Intent匹配action,category和data原则

    1.当你在androidmanifest里面定义了一个或多个action时 你使用隐式意图其他activity或者service时,规定你隐式里面的action必须匹配XML中定义的action,可以 ...

  5. [MODx] 4. getResources

    1. Create a chunk call 'white_content' for white content: <!-- Highlights --> <div class=&q ...

  6. Android项目实战(五十三):判断网络连接是否为有线状态(tv项目适配)

    一般对于android手机,我们可以通过sdk提供的方法判断网络情况 /** * 获取当前的网络状态 :没有网络-0:WIFI网络1:4G网络-4:3G网络-3:2G网络-2 * 自定义 * * @p ...

  7. 最多的划分来使数组有序 Max Chunks To Make Sorted

    2018-12-01 11:05:46 一.Max Chunks To Make Sorted 问题描述: 问题求解: 由于没有重复,所以直观的来看对于每个遇到数,其能够被划分出来的前提是其前面已经有 ...

  8. Android TV 开发(5)

    本文来自网易云社区 作者:孙有军 问题3:TV launcher中没有入口图标 如果需要出现入口图标,你必须要在AndroidManifest中配置action为android.intent.acti ...

  9. Android TV 开发 (1)

    本文来自网易云社区 作者:孙有军 前言 这里主要记录几个TV问题的解决方案,如果对这个不感兴趣的其实就不用往下看了. 这几天有一个需求就是要求出一个TV版本的app,之前没有具体的了解Tv版的app有 ...

随机推荐

  1. Gridview LookupEdit gridLookUpEdit z

    LookupEdit一般用法: 绑定数据源:                                 lookUpEdit.Properties.ValueMember = 实际要用的字段;  ...

  2. 编写一个循环将list容器的元素逆序输出

    <c++ primer>P270,习题9.9 实现代码如下: #include<iostream> #include<list> using namespace s ...

  3. SELECT样式,兼容IE6

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. Codeforces 167B Wizards and Huge Prize(概率dp)

    题意: n个人,开始有一个容量为k得背包,击败一个人背包可以获得一定容量或得到一个财富(放入背包内),给出击败每个人的概率,求至少击败l个人,且背包容量大于获得的总财富值的概率 分析: 状态好确定,d ...

  5. 软件测试技术(四)——闰年判断器+ int.Parse错误如何解决

    目标程序 本次所测试的目标程序是一个闰年判断器,我们知道,一般情况下年份被4整除就可以了,但是如果遇到百年的时候还需要被400整除,于是有了如下的逻辑判断: bool isRunNian = fals ...

  6. 【windows核心编程】DLL相关(2)

    关于DLL的延迟加载 延迟加载DLL,使用的是隐式加载方式,当为exe使用的DLL指定为延迟加载的时候,连接器会将exe的[导入段]中去除该DLL的相关信息,同时在exe中嵌入一个新的[延迟加载段]表 ...

  7. ASM基本操作

    1. 添加一个磁盘组 SQL> create diskgroup recover external redundancy disk 'ORCL:kel3'; Diskgroup created. ...

  8. 如何给10^7个数据量的磁盘文件排序--bitset

    题目: 输入:给定一个文件,里面最多含有n个不重复的正整数(也就是说可能含有少于n个不重复正整数),且其中每个数都小于等于n,n=10^7.输出:得到按从小到大升序排列的包含所有输入的整数的列表. 分 ...

  9. Codeforces Round #362

    A - Pineapple Incident #pragma comment(linker, "/STACK:102c000000,102c000000") #include &l ...

  10. 关于登录的会话控制, 终极解决方案 - chunyu

    登录是用cookie还是session实现,一直有争议,普遍认为session更安全,可是有些功能,用cookie最方便也最高效,比如“记住我一周”.   cookie还是session,我的答案是两 ...