A chunk may be used in many pages, different page may require different style.

We can use Placeholder to pass in the value.

[[+placeholder_name]]

For exmaple, now we want our home page has blue title and about page has green title.

First, we copy the interior template and create two new template call 'Home template' and 'About Template'.

in html_header chunk: we set up the placeholder

      <header class="group">
<div class="logo">
<h1 style="color: [[+html_header_color]]">
[[*longtitle]]
</h1>
</div>

In Home template: a '?' followed by '&' to pass in k-v pair

[[$html_header?&html_header_color=`lightblue`]]

In About template, we do nothing just like:

[[$html_header]]

What we want is use defulat value for the placeholder.

Defulat value:


First: click 'Unlock default properites', then create new property. We set color as lightgreen.

Save it.

Then the page should display as we want.

[MODX] 3. Placeholder +的更多相关文章

  1. [MODx] 8. Snippet get data, chunk display

    Simple Example: Lets process this chunk and output its value. We have this Chunk, called "Welco ...

  2. HTML5轻松实现搜索框提示文字点击消失---及placeholder颜色的设置

    在做搜索框的时候无意间发现html5的input里有个placeholder属性能轻松实现提示文字点击消失功能,之前还傻傻的在用js来实现类似功能... 示例 <form action=&quo ...

  3. Placeholder如何换行

    使用js动态添加标签充,处理换行问题 var placeholder = 'This is a line \nthis should be a new line'; $('textarea').att ...

  4. 关于input标签和placeholder在IE8,9下的兼容问题

    一. input常用在表单的输入,包括text,password,H5后又新增了许多type属性值,如url, email, member等等,考虑到非现代浏览器的兼容性问题,这些新的type常用在移 ...

  5. 兼容IE8 input的placeholder的文字显示

    if( !('placeholder' in document.createElement('input')) ){ $('input[placeholder],textarea[placeholde ...

  6. input type="datetime-local" 时placeholder不显示

    一个坑,input的type="datetime-local" 时,电脑上会显示提示,如图 <input type="datetime-local" na ...

  7. input placeholder属性 样式修改(颜色,大小,位置)

    placeholder属性 样式修改 <!DOCTYPE html> <html> <head> <meta charset="utf-8" ...

  8. UITextField的placeholder文字的位置,颜色等的自定义设置

    //控制placeHolder的位置,左右缩20 -(CGRect)placeholderRectForBounds:(CGRect)bounds { CGRect inset = CGRectMak ...

  9. placeholder实现的两种方式

    /** * PlaceHolder组件 * $(input).placeholder({ * word: // @string 提示文本 * color: // @string 文本颜色 * evtT ...

随机推荐

  1. MyBatis的association示例——MyBatis学习笔记之三

    前两篇博文介绍的都是单表映射,而实际上很多时候我们需要用到较复杂的映射.今天学会的association的用法,就是一例,现写出来和大家分享(为简洁起见,ant工程中各文件.目录的布局,以及其它与前面 ...

  2. 《Python核心编程》 第八章 条件和循环

    8–1.条件语句. 请看下边的代码 # statement A if x > 0: # statement B pass elif x < 0: # statement C pass el ...

  3. Linux基本命令(2)有关磁盘空间的命令

    有关磁盘空间的命令 命令 功能 mount 挂载文件系统 umount 卸载已挂载上的文件系统 df 检查各个硬盘分区和已挂上来的文件系统的磁盘空间 du 显示文件目录和大小 fsck 主要是检查和修 ...

  4. ORA-15124 数据库启动阶段报错

    重新进行启动数据库的时候报错: SQL> startup nomount; ORA-15124: ASM file name '+KEL/ipap/controlfile/control02.c ...

  5. 使用Google Chart API绘制组合图

    Google Chart API 绘图 组合图作者:方倍工作室 地址: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN& ...

  6. (R)?ex - A simple framework to simplify system administration and datacenter automation

    找工作-互联网招聘求职网-拉勾网 5-10年 (R)?ex - A simple framework to simplify system administration and datacenter ...

  7. Cognos 增加全局类

    Cognos使用版本10.1.1 由于我服务器装的是linux系统下的,所以window系统下的方法,提一下,但是没有实现过. 1.Linux系统下增加全局类 ●修改GlobalReportStyle ...

  8. Laravel Configuration

    Introduction All of the configuration files for the Laravel framework are stored in the app/config d ...

  9. hdu 1443 Joseph (约瑟夫环)

    Joseph Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Subm ...

  10. VPN Gate Client v4.11-免費、無限流量VPN翻牆(跳板)軟體(使用教學)

    VPN Gate Client安裝教學 ▼把下載的檔案壓縮後,開啟安裝檔案. ▼接下來就是一般安裝步驟,下一步>下一步   ▼同意>下一步>下一步   ▼安裝目錄可以用預設的也可以自 ...