Hello,

I've currently set up several images on the page to use the the view lightbox trigger.

However, the urls have a space in between the page url and the #...like

www.example.com/mypage #lightbox-popup-22

This is causing crawlers to index www.example.com/mypage several times...and I am seeing the following after a crawl analysis:
www.example.com/mypage%20
www.example.com/mypage%20%20
www.example.com/mypage%20%20%20
www.example.com/mypage%20%20%20%20
...and so forth (to about 50 of them)

Is this the expected behavior? Is it possible to remove this space?

Thanks,

KH

Comments

vanderstaaij’s picture

Version: 6.x-1.x-dev » 6.x-1.11

I am experiencing the same issues on a site. From a SEO perspective this is unwanted behaviour. Suggestions are welcomed.

SchwebDesign’s picture

Assigned: Unassigned » SchwebDesign

We discovered this issue too but unfortunately only after a clients site took a huge hit in SERP rankings. Here's what we changed in effort to fix this:

Change lightbox2_handler_field_lightbox2.inc line 160 from

     return "<a href='$link #lightbox-popup-{$i}'  rel='lightmodal[{$group_name}|width:" . ($this->options['width'] ? $this->options['width'] : '600px') . ';height:' . ($this->options['height'] ? $this->options['height'] : '600px') . "][" . $caption . "]'>". $tokens["[{$this->options['trigger_field']}]"] ."</a>

to:

      return "<a href='$link#lightbox-popup-{$i}'  rel='lightmodal[{$group_name}|width:" . ($this->options['width'] ? $this->options['width'] : '600px') . ';height:' . ($this->options['height'] ? $this->options['height'] : '600px') . "][" . $caption . "]'>". $tokens["[{$this->options['trigger_field']}]"] ."</a>

Thanks for the great module work.

SchwebDesign’s picture

sorry, but i didn't realize until just now that the above fix, although fixing the issue with the space in the href... also renders the lightbox popup non-functional. When the space is removed, the lightbox trigger field popup simply displays the webpage inside the modal popup... rather than whatever is set with the view. When the space exists, the popup works as expected. Any help with how to rectify this would be greatly appreciated! Anyone have any thoughts?

SchwebDesign’s picture

Just wanted to share my current solution. Hope this helps somebody.

Change lightbox2_handler_field_lightbox2.inc line 160 from

     return "<a href='$link #lightbox-popup-{$i}'  rel='lightmodal[{$group_name}|width:" . ($this->options['width'] ? $this->options['width'] : '600px') . ';height:' . ($this->options['height'] ? $this->options['height'] : '600px') . "][" . $caption . "]'>". $tokens["[{$this->options['trigger_field']}]"] ."</a>

to:

      return "<a href='$link%20#lightbox-popup-{$i}'  rel='lightmodal[{$group_name}|width:" . ($this->options['width'] ? $this->options['width'] : '600px') . ';height:' . ($this->options['height'] ? $this->options['height'] : '600px') . "][" . $caption . "]'>". $tokens["[{$this->options['trigger_field']}]"] ."</a>

In summary, rather than removing the 'space' character in the anchor's href, which breaks the lightbox modal popup functionality, I've replaced it with the url encoded version '%20' which retains the lightbox modal popup functionality for lightbox trigger.

gaurishankar’s picture

But it is not resolved problem completely because you right click on image and click to open image in other url that gives " Page not found". Because, space remain exist. Your solution removes space only in view source page not in site.