[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有 ...
随机推荐
- Android aidl 打入jar解决方法
工程上右键 选择export 然后取消选择这个工程里的所有的文件 点开到gen文件夹下选择aidl生成的 java文件 选择生成的java文件和src目录导出jar包即可
- 自定义TreeList单元格 z
DevExpress Treelist自定义单元格,加注释和行序号.以上一节的列表为例,实现以下效果:预算大于110万的单元格突出显示,加上行序号以及注释,如下图: 添加行序号要用到CustomDra ...
- DzzOffice添加动态壁纸例子-Bing每日壁纸
Bing每日壁纸介绍:bing网站每天会更新一张不同的精选图片. 此压缩包内的程序,可以自动同步更新cn.bing.com网站每天更新的图片,作为dzzoffice的壁纸使用.实现自动每天更换不同的云 ...
- GRID控件删除之前确认
<asp:TemplateField HeaderText="删除新闻" ShowHeader="False"><ItemTemplate&g ...
- oracle检查点checkpoint信息
1.关于checkpoint的概述 checkpoint是oracle在数据库一致性关闭.实例恢复和oracle基本操作中不可缺少的机制,包含以下相关的含义: A.检查点的位置(checkpoint ...
- Motan学习开篇
你已经走到这里了,后面只要耐心的走下去就行了. --佚名 入职新公司以后,公司使用dubbo框架,简单的照葫芦画瓢之后,也算是入手了,但是其中内部的实现的机制一概不懂.我单纯的有种好奇心,觉得每个 ...
- mysql操作时遇到的小问题
mysql数据库在程序中执行sql语句时,或者在执行sql时,数据库表可能会有一些特殊的字符,比如说#,.等,这样在执行时 可能会遇到问题 如以下的表名,backup_2014.2.22, 这个表在查 ...
- 结合Vim ghostscript 将源代码文件转换成语法高亮的pdf格式文档
step 1: 安装ghostscript (debian 环境, 其他环境自行google) sudo apt-get install ghostscript step 2: 用Vim生成ps文件 ...
- java易混淆概念之类变量、成员变量、局部变量
类变量.成员变量.局部变量 类变量(也叫静态变量)是类中独立于方法之外的变量,用static 修饰.(static表示“全局的”.“静态的”,用来修饰成员变量和成员方法,或静态代码块(静态代码块独 ...
- 第二百四十六天 how can I 坚持
领悟啊.好伤心啊. 到底应该是怎样的一个过程,才能得到想要的结果啊. 我不懂我自己.. 睡觉吧. 中午吃的米线. 好渴,晚上没喝水呢,活该.谁让你一直玩游戏. 睡觉了.弟弟回家了,过两天去烟台待一个月 ...