[MODX] 3. Placeholder +
placeholder
2023-09-14 09:00:55 时间
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.
相关文章
- 1kb 的 placeholder.js 增加 img 标签使用方式
- spring中context:property-placeholder/元素
- spring中context:property-placeholder/元素
- context:property-placeholder
- [React + CSS3] Create an Animate Content Placeholder for Loading State in React
- Atitit java字符串模板渲染总结 目录 1. 总结:指标1 1.1. 支持中文变量 提升可读性1 1.2. 变量placeholder简单性,,velo可以直接¥前导简单。。Free的
- 成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
- 成功解决ValueError: Cannot feed value of shape (80, 15, 1, 1) for Tensor 'Placeholder_1:0', which has sh
- 成功解决AttributeError: module tensorflow has no attribute placeholder
- 2.6 tensorflow2.3学习--占位符placeholder
- AI学习之路(20)占位符(placeholder)的使用
- spring boot 启动错误:Could not resolve placeholder