There are many attempts have been taken to find the best TV for Easy 2 Gallery.
Since E2G can retrieve both Folder and File types simultaneously, the previous TVs can not do both.
While I can not change the left Resource Tree, I’ll keep using TV as our gallery tree browser.
Thanks to
@sharkbait &
@fixedmachine whom gave
their previous code and
@mmice which pointed me a snippet from
http://community.modx-cms.ru/blog/tips_and_tricks/784.html , since it is shorter than my get_folder function
Hereby I try to bridge this void.
Template Variable
Name:
e2g-galleries
Caption:
e2g-galleries
Description:
Image gallery selection
Input Type:
Listbox (Multi-Select) (I still have no idea how to make the box gets longer, since MODx looks like limits the height)
Input Option Values:
@EVAL return $modx->runSnippet(’getE2GTree’);
Widget:
Delimited List
Delimiter: ,
(comma)
Don’t forget to apply this TV to your Template in the
Template Access check box.
Snippets
We need 2 snippets:
1. ’getE2GTree’ : getE2GTree.txt
Description: The image gallery tree inside the ’e2g-galleries’ Template Variable.
2. ’getE2Gids’ : getE2Gids.txt
Description: TV Parser for Easy 2 Gallery’s front-end snippet
Snippet Call
[!easy2? &gid=`[[getE2Gids? &give=`gid`]]` &fid=`[[getE2Gids? &give=`fid`]]`!]
Yeah... it’s about
giving the parameter.
Please provide both parameters, since the TV also feeds both.
Please notice the cached and uncached call.
...... and you’re done.
Now you can make multiple selection on the listbox, both for &gid and &fid parameters’ feeding.
Have fun, you all...