I’m using Revo 2.0.0 and I’m very much a newbie.
I’m struggling to get my head around TVs and how to access the information in them. I have added an image TV ’articlePhoto’ to an articleTemplate and populated it for various resources. The TV has an image type output.
I’ve made a stack of those resources on an index page using getResources with a nice little template for each ’row’, and after some trial and error I got it to fetch and display the image I was expecting - however, I don’t want the image rendered using its normal output template, I want to either give it a new template or be able to populate the img src value (and change the height / width settings there).
1. Is this doable?
2. Is this sensible - should I instead get the manager user to upload another ImageTV of type ’thumbnailPhoto’?
or is this where the mythical property sets come in? size=`thumb||full||article` or something (although I don’t have the foggiest how I would implement that....)
Help appreciated.
Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
Ok. The solution to my first issue is to not process the TV in the getResources call:
[[!getResources? &parents=`11` &hideContainers=`1` &tpl=`accordionPostsTpl` &limit=`4` &sortby=`id` &sortdir=`ASC`&includeTVs=`1`&processTVs=`0`]]
I then get the reference to the filename of the image as the output of the TV, and can manipulate accordingly. Which is ridiculously simple and annoys me that I spent so long to find the solution. But I guess it was implicit. Anyhoo.
Whether this is sensible or not (as per my second question), I leave to the ether....
Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86