1. ADD Chunk:
For example, replace the header by using the chunk.
Usage: [[$chunk _name]]
- Cut all the header code from the Learn template
<!DOCTYPE HTML><!--Escape Velocity by HTML5-html5up.net | @n33co free for personal and commercial use under the CCA 3.0 lice NSE (Html5up.net/license) -<HTML> <Head> <title>[[++site_name]]-[[*pagetitle]]</title> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <Metaname= "description"content="" /> <Metaname= "keywords"content="" /> <!--[If LTE IE 8]><script src= "Css/ie/html5shiv.js" ></script><! [EndIf] - <Scriptsrc= "Js/jquery.min.js"></Script> <Scriptsrc= "Js/jquery.dropotron.min.js"></Script> <Scriptsrc= "Js/skel.min.js"></Script> <Scriptsrc= "Js/skel-layers.min.js"></Script> <Scriptsrc= "Js/init.js"></Script> <NoScript> <Linkrel= "stylesheet"href= "Css/skel.css" /> <Linkrel= "stylesheet"href= "Css/style.css" /> <Linkrel= "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'll see there are a new tab call Tempalte variable
- You'll see a rich text inside template variable and 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 - <DivID= "Intro-wrapper"class= "wrapper Style1"> <Divclass= "title">The Introduction</Div> < SectionID= "Intro"class= "Container"> <Pclass= "Style1">[[*favortext]]</P> <Pclass= "Style2">
- View the page to see the change
3.down to the Category:
You can notice this, in the template variable, it show Uncategorized:
You can decide the category which your 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 - <DivID= "Intro-wrapper"class= "wrapper Style1"> <Divclass= "title">[[*titletag]]</Div> < SectionID= "Intro"class= "Container"> <Pclass= "Style1">[[*favortext]]</P> <Pclass= "Style2">
- In the ' Learn ' document, template variable, add value to the Titletag
[MODx] 3. Working with chunks, TV, Category