Hi guys. In your opinions, what would be the best and easiest way to rig up a template so that a user can quickly insert a slideshow or gallery into a newspost? Almost as if TinyMCE had a magic "insert gallery" button... Thanks!
-
☆ A M B ☆
- 1,780 Posts
You can use a MIGX TV for the images, a slider (pick one) and then another TV yes/no radio button to turn it on and off. Use the Switch snippet/extra in the template to show it or not, or the If extra and place the code in a chunk. Don't forget to assign the TV's to the article template.
With Switch:
[[switch?
&get=`[[*optional_slider]]`
&c1=`yes`
&do1=`
<div id="slider">
[[!getImageList? &tvname=`migxMultiItemGrid` &docid=`[[*id]]` &tpl=`slideTpl`]]
</div>
`&default=``]]
With If
[[If? &subject=`[[*optional_slider]]` &operator=`EQ` &operand=`yes` &then=`[[$migxSlider]]` &else=``]]
migxSlider Chunk:
<div id="slider">
[[!getImageList? &tvname=`migxMultiItemGrid` &docid=`[[*id]]` &tpl=`slideTpl`]]
</div>
Check out Mark Hamstra's tutorial for MIGX galleries as well.
https://www.markhamstra.com/modx-blog/2012/04/managing-galleries-with-migx/
Thanks. I'll try this option out.