I have in my node the integer field "teller" and a file field called "bestand". I would like to increase the teller field when the url of file field bestand is clicked. Can I do this with rules? Pls some help
Asked
Active
Viewed 174 times
1 Answers
0
Depens a bit on the URL of the file field you are talking about. Is this the file/%file/view url or the actual download url to the uploaded file?
There are quite a few different options but i'm not sure if Rules is the one you are looking for.
- Add a JS click handler to the link that fires an Ajax call which updates the 'teller' field. Will not update the 'teller' field if a file url is opened directly.
- Override the 'file/%file/view' callback with hook_menu_alter(), add your own magic and at the end return the output of file_entity_view_page();
- Implement hook_file_view() and add your custom code there.
If you insist on working with Rules you should probably use the Entity Rules module and catch the 'File is viewed' event.
Kind regards, Eric Mulder

Eric Mulder
- 171
- 1
- 3