Well, I needed a quick fix for being able to link a picture to a document via a TV and simultaneously create a thumbnail when uploading the pic.
The code is still a mess but I can adjust it a bit and then post it.
For those interested, the whole cycle looks like this:
I have a list of articles, each article has one or no pictures.
The image filename is stored in a TV of the Image type.
I have a folder on server which contains images I’d like to use as "news pictures".
When listing the articles I show their thumbnail.
When showing the article I display the original image.
The article adding form has a select input field which lists all the pictures in a specified folder.
Once you select one, there’s an instant preview available.
In you’d like to upload a new picture, an input field for that is available too.
Once you upload the picture, the snippet creates a thumbnail, saves it on the server, saves the uploaded picture, sets the TV containing the image filename.
If you edit the article in manager, you can easily select another pic from anywhere on your server via resource browser.
When I list the articles on the web page a snippet checks if the thumbnail exists, otherwise it is recreated on the fly.
And that’s it. For now.
Next step is to integrate the procedure into eForm for better error handling (well, now there isn’t any

). I’ll get back when I’ve finished it.