[MODx] 3. Working with chunks, TV, Category
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的更多相关文章
- Scrapy-redis 安装配置使用
# 安装redis服务器端 sudo apt-get install redis-server # 安装scrapy和scrapy-redis库 pip install scrapy pip inst ...
- 基于Node.js的爬虫工具 – Node Crawler
Node Crawler的目标是成为最好的node.js爬虫工具,目前已经停止维护. 我们来抓取光合新知博客tech栏目中的文章信息.访问http://dev.guanghe.tv/category/ ...
- [MODX] 2. Chunks $
Chunk in Modx can cut your template into samll pieces to make code reuseable. [[$chunk_name]] For ex ...
- Android为TV端助力 Intent匹配action,category和data原则
1.当你在androidmanifest里面定义了一个或多个action时 你使用隐式意图其他activity或者service时,规定你隐式里面的action必须匹配XML中定义的action,可以 ...
- [MODx] 4. getResources
1. Create a chunk call 'white_content' for white content: <!-- Highlights --> <div class=&q ...
- Android项目实战(五十三):判断网络连接是否为有线状态(tv项目适配)
一般对于android手机,我们可以通过sdk提供的方法判断网络情况 /** * 获取当前的网络状态 :没有网络-0:WIFI网络1:4G网络-4:3G网络-3:2G网络-2 * 自定义 * * @p ...
- 最多的划分来使数组有序 Max Chunks To Make Sorted
2018-12-01 11:05:46 一.Max Chunks To Make Sorted 问题描述: 问题求解: 由于没有重复,所以直观的来看对于每个遇到数,其能够被划分出来的前提是其前面已经有 ...
- Android TV 开发(5)
本文来自网易云社区 作者:孙有军 问题3:TV launcher中没有入口图标 如果需要出现入口图标,你必须要在AndroidManifest中配置action为android.intent.acti ...
- Android TV 开发 (1)
本文来自网易云社区 作者:孙有军 前言 这里主要记录几个TV问题的解决方案,如果对这个不感兴趣的其实就不用往下看了. 这几天有一个需求就是要求出一个TV版本的app,之前没有具体的了解Tv版的app有 ...
随机推荐
- 开学了!这些Linux认证你要知道。
导读 大家好,今天我们将认识一些非常有价值的全球认可的Linux认证.Linux认证是不同的Linux专业机构在全球范围内进行的认证程序.Linux认证可以让Linux专业人才可以在服务器领域或相关公 ...
- 【Mongo】Linux安装MongoDB
呵呵哒,每天都是小惊喜. 一 下载 https://www.mongodb.org/downloads可进行下载,根据需要选择合适的版本和操作系统 二 上传服务器 1 上传服务器路径并解压 2 创建数 ...
- ZOJ 3329-One Person Game(概率dp,迭代处理环)
题意: 三个色子有k1,2,k3个面每面标号(1-k1,1-k2,1-k3),一次抛三个色子,得正面向上的三个编号,若这三个标号和给定的三个编号a1,b1,c1对应则总和置零,否则总和加上三个色子标号 ...
- HDU 3584-Cube(三维BIT)
题意: 给你三维空间两种操作,给出两顶点坐标,把它们确定范围(长方体)内的数全部取反.查询给定点的值.初始全部为零 分析: 有了前面的知识,用BIT实现区间更新单点查询,再用多维实现即可 #inclu ...
- Selenium - IDE模式匹配
Selenium - IDE模式匹配 在Selenium IDE中,如定位器,模式是selenium中经常使用的一种类型的参数.它允许用户描述特殊字符的模式.很多时候,我们想核实文字是动态的,在这种情 ...
- DataGird导出EXCEL的几个方法
DataGird导出EXCEL的几个方法(WebControl) using System;using System.Data;using System.Text;using System.Web;u ...
- asp.net 常用的几种调用存储过程的方法
(1)简单的无参数存储过程 create procedure ExpOneasselect top 10 * from Corpgo C#调用此存储过程 SqlConnection co ...
- 将spfile存储在ASM中
数据库的spfile开始是存储在普通的文件系统中,如下所示: SQL> show parameter spfile NAME TYPE VALUE ----------------------- ...
- 关于Noise and Error主题的一些小知识
(一)Noise会不会对VC bound产生影响? 此笔记源于台湾大学林轩田老师<机器学习基石><机器学习技法> 答案是不会. 当信号中加入了Noise,其实对我们之前学过的内 ...
- CSS Sprite的优缺点分析
目前大多数的开发人员对这个技术都有相当地掌握,也有很多关于它的教程和文章.几乎所有的文章中都宣称设计师和开发人员都应该使用 CSS sprite 来减少 HTTP 请求数,并且节省一些流量.这个技术被 ...