Hi, i have just found out about modx....
And i am trying to learn some basic stuff. Like how to create a template variables and how they work.
For example this is my web template:
<html>
<head>
<title>[[++site_name]] - [[*pagetitle]]</title>
<base href="[[++site_url]]" />
</head>
<body>
[[*content]]
</body>
</html>
and i would like to add keywords and description but don’t know how to do it!!! can someone plz expalin how the template variables works??
Easy as pie. On the Elements tab, Just do this:
1. Right-click on the Template Variables folder and select "New Template Variable." Put it Keywords in the Variable Name and Caption fields and a default keyword (or several) in the Default Value field. Leave the other fields alone.
2. Click on the Template Access tab (still in the right panel) and check any templates that you want to use the TV with. Click on the "Save" button.
3. In your template, put:
[[*Keywords]] where you want to keywords to appear (i.e., inside a <meta> tag).
At this point, the default keywords should appear in the source of your pages.
4. Now, edit each document, click on the Template Variable tab in the right panel, and fill in the keywords for that page in the Keywords TV and save the page.
Now, the appropriate keywords should appear in the source for each page.
5. Repeat the process for a Description TV.
The site in my sig has some more information on TVs (and other stuff).