I am attempting to use Modx for a portfolio site. I’m new at this and not really a programmer so bear with me.
What I’ve done to this point is created a different page for each portfolio entry. I have a title of the work and descriptions. This is pretty straight forward because I’ve used the forms provided by default. What I would like to be able to do is attach photos of the work and associate them with each page. I have a pretty good grasp of template variables, but I’m thinking there might be a better way that I’m unaware of.
So lets say I have 5 portfolio pages each representing a different piece of work and I want to associate 5 photos with each of the pages. Will I have to create 25 unique template variables for each of the images and insert them into each page accordingly?
Any thoughts or techniques I’m unaware of would be greatly appreciated.
Hi there,
the value for each TV will/can change for each document, so portfolio page 2 will show the image you assign to it on page 2
cheers, j
The template variables are actually "Custom Document Variables Grouped and Assigned by Templates" so the TV content or value will be tied to the current page. Each document (or page) will have it’s own values for the template variables.
You can instruct MODx to inherit the TV values from parent documents by using the @INHERIT binding. This is handy for instances where an image is to be carried over from a parent document like a section header.
Then if you want to create an index page for the portfolio with an image from each job you would use Ditto (or Wayfinder depending on your requirements).
Brilliant!
Thank you all for your help.
Sorry, one more.
I think it’s starting to click for me now.
So, then based on the above example if I create a chunk and insert a placeholder with [+image1+], and use Ditto pulling from the parent portfolio it will inturn display the template variable value for image1 from every page?