Hello,
I tried to find this info but couldnt, i probably was searching wrong or looking in the wrong places. But what i want to do is, within my template do a check on what page it currently is (for example, is this the homepage. ID=1?) and output some markup code.
What is the syntax to accomplish this? Thanks!
-
☆ A M B ☆
- 24,524 Posts
There are several ways you can do this, depending on exactly how much HTML markup you are inserting, and on how many pages you'll want to do this.
The way that first comes to mind for a simple case is to use an output modifier. Something like this
[[*id:isequalto=`1`:then=`<div class="myclass"></div>`:else=``]]
http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+%28Output+Modifiers%29
You can also use a chunk to hold the markup you want and specify the chunk
http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/
If it's more complex than this, please explain more precisely what you have in mind.
Hi sottwell, thanks for that info. That's helpful!