#83 Posted in ‘Route 66’

Latest post by Lefteris Kavadas on Tuesday, 10 October 2017 16:35 EEST

PATRAT Sebastien
 Hi,

There is a problem in the sitemap generation: when i use remote pictures the sitemap write this :
<image:loc>
https://www.mybesite.com/https://img.myremotecdnimg.com/440x300.jpg
</image:loc>

I need this :
<image:loc>
https://img.myremotecdnimg.com/440x300.jpg
</image:loc>

Can you fix this or explain where can i change the code ?

Thank you

Lefteris Kavadas
Hi,

Can you please clarify? How are you using remote images? Is this about Joomla articles or K2 Items?

PATRAT Sebastien
It's for Joomla content.

Lefteris Kavadas
Here is the fix. Edit file /plugins/route66/content/content.php and replace lines 49 - 60 with the following code:

                if (isset($images->image_fulltext) && $images->image_fulltext) {
                    $image = new stdClass();
                    if(strpos($images->image_fulltext, 'http://') === 0 || strpos($images->image_fulltext, 'https://') === 0 || strpos($images->image_fulltext, '//') === 0)
                    {
                      $image->url = $images->image_fulltext;
                    }
                    else
                    {
                      $image->url = JUri::root(false).$images->image_fulltext;
                    }
                    $image->caption = $images->image_fulltext_caption;
                    $item->images[] = $image;
                }
                if (isset($images->image_intro) && $images->image_intro) {
                    $image = new stdClass();
                    if(strpos($images->image_intro, 'http://') === 0 || strpos($images->image_intro, 'https://') === 0 || strpos($images->image_intro, '//') === 0)
                    {
                      $image->url = $images->image_intro;
                    }
                    else
                    {
                      $image->url = JUri::root(false).$images->image_intro;
                    }
                    $image->url = JUri::root(false).$images->image_intro;
                    $image->caption = $images->image_intro_caption;
                    $item->images[] = $image;
                }


Please let us know if that solves the issue.

PATRAT Sebastien
The bug is still existing :

<image:loc>https://www.mywebsite.com/https://img.grouponcdn.com/deal/2mWkd9TGhYMhgwT5CGwRwQiPZZ2M/2m-960x576/v1/t440x300.jpg</image:loc>

PATRAT Sebastien
Here is an example of the data in my DB :

{"image_intro":"https://img.grouponcdn.com/deal/FN1ScPvzuAotmQh5GkBXzrkJ8iN/FN-1016x610/v1/t440x300.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}

Lefteris Kavadas
Are you sure that it's not cached? Can you please try cleaning Joomla cache?

Lefteris Kavadas
OK it's not cache. We forgot one extra line of code.

Just remove the line 72 and everything should work as expected.

PATRAT Sebastien
Perfect. Great job. Thank you !

PATRAT Sebastien
Will you fix this in next version or will i ll be oblige to do this again ?

Lefteris Kavadas
Of course, the fix will be included in the next update of Route 66.

I would like to thank you for reporting this issue.

If you like Route 66 PRO it would be great if you post a review at the Joomla extensions directory .

Let us know if you need anything else.

Regards

PATRAT Sebastien
Thank you. Perfect

Lefteris Kavadas
You are welcome.

Note: An active subscription is required in order to get support for our paid extensions. For our free extensions, if you don't have an account, register and then submit your support request.  In case you just want to ask a question, you can also use the contact form .

Firecoders
Are you using our extensions? Please post a review at the Joomla extensions directory!
Post a review