Closed rihamNasleh closed 3 years ago
Hey @rihamNasleh,
I don't think this is possible.
It’s not possible to modify the meta tags using javascript simply because the facebook “scraper” doesn’t run the javascript in the pages it scrapes. It reads the html as-is. The only way to modify the meta tags dynamically is to dynamically create the html page itself.
References
This is not a lightGallery problem. This is how Facebook processes the content.
Closing the issue. Please let me know if you have any other questions
Hello I need some help to edit sharing feature in current version, sharing on facebook button shares the whole page, not the current active image so to complete this action I should change the meta tag content to be changed dynamically I add to "v1->lightgalleryjs->lg-thumbnail.js" these 3 lines of code at the end of this function _this.core.$el.on('onBeforeSlide.lg.tm', function() { $thumb.removeClass('active'); $thumb.removeAttr('id'); $thumb.eq(_this.core.index).addClass('active'); //the new 3 lines var newValue = 'www.mydomainname.s'+ $thumb.eq(_this.core.index).find('img').attr('src').replace('..', '');
and the value changed -check the attached image- , but did not work! just continue with the first meta tage content value that assigned at the head . plz help me to find solution to this issue
Thanks in regards