[MODX] 3. Placeholder +

Source: Internet
Author: User
Tags modx

A Chunk is used in many pages and 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 have blue title and about page have green title.

First, we copy the interior template and create the new template call ' Home template ' and ' about template '.

In Html_header Chunk:we set up the placeholder

      <Headerclass= "group">        <Divclass= "logo">          <H1style= "COLOR: [[+html_header_color]]">[[*longtitle]]</H1>        </Div>

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

[[$html _header?&html_header_color= ' LightBlue ']

In the about template, we don't just like:

[[$html _header]]

What we want are 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 +

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.