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. Android的SoundPool

    开发Android软件中我们可能经常需播放多媒体声音文件,一般使用MediaPlayer类但该类占用资源较多,对于游戏等应用可能不是很适合,SoundPool类在SDK的android.media.S ...

  2. Selenium - IDE模式匹配

    Selenium - IDE模式匹配 在Selenium IDE中,如定位器,模式是selenium中经常使用的一种类型的参数.它允许用户描述特殊字符的模式.很多时候,我们想核实文字是动态的,在这种情 ...

  3. springMVC(注解版笔记)

    springMVC(注解版) 较之于非注解版本,发生一下变化: 1.配置文件需要配置的标签有: <!-- 包的扫描,此包下面的所有包都启用注解 --> <context:compon ...

  4. 几个地图(高德、百度、Apple、Google)URL API(转)

    转自:http://blog.csdn.net/cooldragon/article/details/20642131 移动应用中,如何在自己的App中调起第三方的原生地图App,并显示相关的信息,如 ...

  5. 教你利用iframe在网页中显示天气

    来源:http://www.ido321.com/921.html css: 1: *{margin:0;padding:0;list-style-type:none;} 2: a,img{borde ...

  6. Hadoop中FileSystem的append方法

    今天在使用Hadoop 1.1.2版本进行FileSystem的append操作时报以下异常: org.apache.hadoop.ipc.RemoteException: java.io.IOExc ...

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

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

  8. [置顶] Kendo UI开发教程: Kendo UI 示例及总结

    前面基本介绍完Kendo UI开发的基本概念和开发步骤,Kendo UI的示例网站为http://demos.kendoui.com/ ,包含了三个部分 Web DemoMobile DemoData ...

  9. C++11 能好怎?

    0. 摘要 近期读了一些关于C++11标准的材料. 本篇博客将从新标准的优点.与旧版本的区别和使用方法三个角度,大致介绍我对C++11的认识. C++11标准,原名C++0x, 是03版旧标准的更新. ...

  10. [iOS基础控件 - 6.11.4] storyboard 的 Segue

    A.概念 storyboard中的跳转事件连线,都是一个UIStoryboardSegue对象(Segue)   来源控制器      触发控制器 目标控制器      跳转到的控制器     Seg ...