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. C++ Primer学习_第1章

    源文件后缀 在大多数的系统中,源文件的名字以一个后缀为结尾,后缀是由一个句点后接一个或多个字符组成的.后缀告诉系统这个文件是一个C++程序.不同编译器使用不同的后缀命名约定,最常见的包括.cc..cx ...

  2. Java Spring boot 系列目录

    Spring boot 介绍 Spring boot 介绍 Spring boot 介绍 Spring boot 介绍 Spring boot 介绍 Spring boot 介绍 Spring boo ...

  3. YARN应用场景、原理与资源调度

    1.Hadoop YARN产生背景 源于MapReduce1.0 运维成本 如果采用“一个框架一个集群”的模式,则可能需要多个管理员管理这些集群,进而增加运维成本,而共享模式通常需要少数管理员即可完成 ...

  4. Spark系列(九)DAGScheduler工作原理

    以wordcount为示例进行深入分析 1  33  ) { 46        logInfo("Submitting " + tasks.size + " missi ...

  5. 从零教你在Linux环境下(ubuntu)如何编译hadoop2.4

    问题导读: 1.如果获取hadoop src  maven包?2.编译hadoop需要装哪些软件?3.如何编译hadoop2.4?扩展:编译hadoop为何安装这些软件? 本文链接 http://ww ...

  6. 一个考察for循环题 讨论一下

    一道Java程序题,主要是考察for循环如下所示: public class Test { static boolean fun(char c) { System.out.print(c); retu ...

  7. Unity3D文件读写

    这里主要是简单的文件读写,不推荐使用,最好用的还是PlayerPrefs. using UnityEngine; using System.Collections; using System.IO; ...

  8. Nodejs与Net 和SQL 交互利器Edge.js

    https://github.com/tjanczuk http://www.cnblogs.com/joylee/archive/2013/02/05/msnodesql.html edge.js这 ...

  9. Struts2类型转换器

    概述 A .从一个HTML 表单到一个 Action 对象,类型转换是从字符串到非字符串.    –HTTP没有"类型" 的概念.每一项表单输入只可能是一个字符串或一个字符串数组. ...

  10. (转载)JDOM/XPATH编程指南

    JDOM/XPATH编程指南 本文分别介绍了 JDOM 和 XPATH,以及结合两者进行 XML 编程带来的好处. 前言 XML是一种优秀的数据打包和数据交换的形式,在当今XML大行于天下,如果没有听 ...