Titan-Framework icon indicating copy to clipboard operation
Titan-Framework copied to clipboard

Gallery Option

Open mathieupreaud opened this issue 8 years ago • 5 comments

Hi,

I just tried for the first time the Gallery option and I'm facing to a problem. When I upload the second image, it always deletes the first one and takes its position.

Anyone found out how to resolve this issue?

I'm using the last version of TF (1.11) and WP (4.7).

Thank you!

mathieupreaud avatar Jan 04 '17 17:01 mathieupreaud

Anyone can confirm this issue?

mathieupreaud avatar Jan 10 '17 12:01 mathieupreaud

Its happening with me too. Wordpress 4.7.5 and Titan 1.11

MarienSoria avatar Jun 04 '17 21:06 MarienSoria

In the name of Allah, I fix the problem:: put this code in class-option-gallery.php which is in lib folder. the best place for putting your code is line 148::

` frame.on('open',function() {

                var selection = frame.state().get('selection');
                if(_input.val()!="")
                {
                    var ids = _input.val().split(',');
                    ids.forEach(function(id) {
                        var attachment = wp.media.attachment(id);
                        attachment.fetch();
                        selection.add( attachment ? [ attachment ] : [] );
                    });
                }

            });`

amin3d avatar Feb 25 '18 04:02 amin3d

it works now, just try is carefully to understand how it works , dont add new code

== when you set-up your type to "gallery" , just go in meta-box in admin panel and test it by add multi images

notes to make it works

  • i think max, images to add " 3 ",
  • the way i found is by click add and CTLR button on keyboard and select 3 images and then click add

you should now see the three images is there, i'm working now on how to display images in the front

emadelawady avatar Nov 18 '18 00:11 emadelawady