I currently have a sidebar chunk in a template that displays an image. I want to vary the image source based on the document ID. I’m sure there is a simple way of doing this, but lack the knowledge to do it. I’m assuming this needs to be done through some kind of php if/else statement and something to do with the documentObject[’id’] but can’t figure out the syntax.
Ultimately I think I want to end with the src for the image being src=some snippet/variable
It would be handy for the API to have some simple examples of usage. I’m caught between asking stupid questions and not quite knowing a good source to up my knowledge on the API.
I think a template variable [*tv*] would be a good fit for this situation.
you could do <img src="[*nameOfTV*]" alt ="" /> in the chunk (or directly in the site template),
then create a new TV called nameOfTV (or whatever you want) as raw text and maybe even give it a default path to an image. on each document you will now be able to edit the path in the tv to a specific per page image.
-sD-
only when you actually see it written down do you realise the simplicity of it. I think I’d fundamentally misunderstood the TVs and how they were used. Thanks for your help, it was what I was looking for.