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. 高性能Server---Reactor模型-----Socket

    高性能Server---Reactor模型   原文地址:http://www.ivaneye.com/2016/07/23/iomodel.html 无处不在的C/S架构 在这个充斥着云的时代,我们 ...

  2. 打印Ibatis最终的SQL语句

    在项目开发时都大家都希望将SQL在后台打印出来,以帮助开发以及后续的bug修改.如果用JDBC那么可以方便的打印,可使用ibatis就不知道怎么办了,最近在网上找了一段log4j的配置可以很保姆的处理 ...

  3. SQL 语句记录

    1.创建一个table @"create table rockTB(myId integer primary key autoincrement not null, time varchar ...

  4. 《Python 学习手册4th》 第十四章 迭代器和解析

    ''' 时间: 9月5日 - 9月30日 要求: 1. 书本内容总结归纳,整理在博客园笔记上传 2. 完成所有课后习题 注:“#” 后加的是备注内容 (每天看42页内容,可以保证月底看完此书) “重点 ...

  5. e2e 自动化集成测试 架构 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (六) 自动化测试结构小节

    上一篇‘e2e 自动化集成测试 架构 京东 商品搜索 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (五) 如何让窗体记录登录 ...

  6. 【Windows核心编程】VirtualAlloc 例子

    // VirtualAlloc.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <Windows.h> #in ...

  7. CSAPP(1):数字的计算机表示——课后题

    2.65 int even_ones(unsigned x) 要求:return 1 when x contains an even number of 1s; 0 otherwise. 假设int ...

  8. UVALive 4763

    一开始,没敢写,感觉会超时...其实就是暴力搜索.DFS #include<iostream> #include<stdio.h> #include<string.h&g ...

  9. HDFS体系结构

    HDFS的设计目标 检测以及快速恢复硬件问题. 流式的数据访问. 移动计算比移动数据的代价小. 简化一致性模型. 超大规模数据集 异构软硬件平台之间的可移植性. HDFS的结构模型HDFS是一个主从的 ...

  10. SQL Server 跨库连接

    -- 开启组件 reconfigure reconfigure -- 关闭组件 reconfigure reconfigure -- 查询远程数据库 SELECT * FROM OPENDATASOU ...