ngGallery
ngGallery copied to clipboard
Possible to open model without ng-gallery
I want to support search engines to get the images from the site, but using ng-gallery
will prevent me doing so.
So I want to implement normal loop of images using img tag and then use javascript (angular) function to open that image in model box and other images to follow on model as gallery images.
Is it possible?
That's a good point. Is there (or is it planned) an official way to work with html in order to allow search engines to crawl the images?
Can you please check the "ngGalleryFromHtmlImages" branch?
Usage example: https://rawgit.bessei-it.eu/SchwarzwaldFalke/ngGallery/ngGalleryFromHtmlImages/examples/imagesFromHtml/index.html
Important: You still need an array inside your scope for the images. Just leave it empty if you add all your images via HTML images.
I needed to quickly overcome the problem so I cheated a bit inserting a php for cycle that prints tags inside the
Hi! I'm not sure if the current solution will help you: It also expects img tags inside the ng-gallery directive and replaces them (as soon as angularJS starts) with the "real" ngGallery html. I don't think the solution has SEO side effects because there are always img tags (Without JS the php generated html and with JS the ngGallery generated html).
Nonetheless: I don't like the current solution. It works but it's kind of ugly. If you have a better idea, I'm all ears. :)
@SchwarzwaldFalke Just so you know, what I have done is
scope: {
controls: '=',
images: '=',
thumbsNum: '@'
},
I have added a controls model for this functionality. Using this like below
//Launch ngGallery remotely
scope.controls = scope.controls || {};
scope.controls.launch = function(index){
var i = index || 0;
scope.openGallery(i);
}
Likewise, any operation can be done from outside using controls model. (close, next, prev etc).
P.S. Using css, you have set .ng-gallery
to display:none