Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to open model without ng-gallery #17

Open
iBasit opened this issue Jan 19, 2016 · 5 comments
Open

Possible to open model without ng-gallery #17

iBasit opened this issue Jan 19, 2016 · 5 comments

Comments

@iBasit
Copy link

iBasit commented Jan 19, 2016

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?

@bogomips
Copy link

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?

SchwarzwaldFalke pushed a commit that referenced this issue Apr 16, 2016
@SchwarzwaldFalke
Copy link
Owner

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.

@bogomips
Copy link

I needed to quickly overcome the problem so I cheated a bit inserting a php for cycle that prints tags inside the tag. When js starts immediately overwrite those html produced by php.
It is a dirty way and it could have side effects becouse search engines (google) execute js.
Now there is an ufficial way and I am glad about that!
I will check it out soon and convert my code.
thanks

@SchwarzwaldFalke
Copy link
Owner

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. :)

@thatisuday
Copy link

thatisuday commented Apr 27, 2016

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants