Hello again!
I’m starting to really like this cms!!
Can I use conditions in the templates?
I want to use them for several cases, but the most current one of them is for the html title of the page.
I want the title of the page to be in the next format:
If I’m in a page with no children or on a parent page, I want the title to be "Pagename".
But if I’m in a child page, I want the title to be "ParentPageName | ChildPageName".
So I thought about checking if the page has parents ([*parent*] > 0) and then act according to the results.
Wow great! It’s working fabulous!
But now I have a completely diffrent question:
How do I get the site URL inside a snippet ?
The DropMenu is giving me a relative path to the children pages, and I’m using friendly URLs, so if I’m inside a child page, and I click on it again or one of it’s "friends", I get a 404 page.
You can use PHx for this inside templates and chunks.
http://modx.com/extras/package/phx" target="_blank" rel="nofollow">
http://modx.com/extras/package/phx It can really help you on small things like making if-statements inside a template/chunk and create small snippets to modify template-variables directly. You really should learn how to use PHx
...I believed it was Friday...