That could be what I need, I’m just not sure where my code needs to go. When you add /edit a document you see a bunch of data fields (Title, longtitle, description etc...) I want to add a couple more fields to this page so I can store extra data about each document in the database. Are TV’s the way to go here?
Thanks
-
MODX Staff
- 10,725 Posts
Absolutely the way to go in most cases. You could also create some additional tables and then create a plugin to render additional stuff on the manager page from these extra data stores, but TV’s already do this for most purposes, and provide a lot of other nice features which might not be achievable without a lot of extra work if going the additional tables/plugin route.
Create a template for your page.
Create a template variable for what you want
Add the template variable to the template
Create a page based on the template and edit the variables
For example, I have a template called "location". I created template variables "longitude" and "latitude" and added them to the location template.
Now every page I create that is based on the location template has longitude and latitude fields at the bottom when editing the page (they appear below the content section).
Andy