Hello,
I want to be able to easily view the image while writing about it in a document, but keep it separate from the content so I can use some of the thumbnail and gallery snippets I’ve found here for modx.
So I added a "view image" toggle button to the image TV, that expands to the image when selected. The code was taken from the modx file manager code, and modified to perform a toggle on an image TV. For this experiment (see images below), I hacked into the tmplvars.inc file.
I noticed the image viewing feature in the file manager section and figured I could "leverage the code". Changes were made to make the image tag unique to the TV (html/javascript/php) and toggle the button (javascript function "viewfile"). Not terribly elegant, but it works.
I’d like to make a plugin for this, or even a new template variable type - something that prevents me from changing the core. But I can’t see how I can do this based on the events that are available in 0.92. Am I missing something basic? Or is this feature (directly viewing the image) already available and I’m just not seeing it?
Many thanks for any help,
M.
Toggle button placement:
Toggled with image viewable: