Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i18n, rss and sitemap.xml - no parent slug in links.
#1
On my site i used plugin i18n. Default language (that was used for pages without "_") is russian and the other language is english (pages with "_en"). When sitemap.xml generated, it's all ok with default language. Adress("loc") of page with slug "about" and parent slug "me" is

http://sitename.com/ru/me/about/

But the same english page (with slug "about_en") in sitemap.xml have adress WITHOUT parent slug:

http://sitename.com/en/about/

Rule for my fancyurl is:

%language%/%parent%/%slug%/

What can i do with this trouble with adress in sitemap.xml?
Please, help.

UPD. With i18n_search plugin and RSS is the same problem. In RSS all links in non-default language are without parent slug. This problem also in admin panel (when click on # for page_nondefaultlanguage viewing)

UPD 2. I installed again last stable version of get-simple on another host with only one plugin - i18n. Nothing changes. There are no parent slug in links (sitemap.xml) with non-default language.

UPD 3. I think, that problem maybe in i18n_base/sitemap.class.php ($pageLoc=...) or in admin/inc/basic.php (find_url function).

It's look like there is no parent page for /parent/mypage_en, when i try to get it with get_parent(), $data->parent etc.

In fact, plugin(s) i18n does not work correctly with non-default languages.
Reply
#2
(2014-03-28, 21:15:16)vestris Wrote: On my site i used plugin i18n. Default language (that was used for pages without "_") is russian and the other language is english (pages with "_en"). When sitemap.xml generated, it's all ok with default language. Adress("loc") of page with slug "about" and parent slug "me" is

http://sitename.com/ru/me/about/

But the same english page (with slug "about_en") in sitemap.xml have adress WITHOUT parent slug:

http://sitename.com/en/about/

Works for me. Make sure you use the latest I18N plugin and update at least a page or the navigation to ensure that the navigation cache is refreshed.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#3
I get the exact same problem here:

<url>
<loc>https://www.screendream.de/generation/?lang=de</loc>
<lastmod>2016-08-09T19:31:14+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>
https://www.screendream.de/sound/generation/?lang=en
</loc>
<lastmod>2016-08-07T17:46:26+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>

Where the main language (en) shows parents in the GS created sitemap, but the second language (de) doesn't.
This confuses Google since there are suddenly different paths to the same page.
I use the latest version of i18n and tried above suggestions to no avail. Any recommendations?

Thanks and Cheers,

Tom
Reply
#4
It's actually the same on the plugin authors homepage:

<url>
<loc>http://mvlcek.bplaced.net/news-20110920-2152:de</loc>
<lastmod>2012-04-13T10:31:53+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>http://mvlcek.bplaced.net/news/news-20110506:en</loc>
<lastmod>2011-05-19T16:15:03+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>

Can this be fixed please? I removed my sitemaps from the google webmastertools since they seemed to create more problems than they help, but it would be good to have this working again...

Thanks and cheers,

Tom
Reply
#5
Four years later problem is not soved. In sitemap.xml and in rss (i18n search plugin) there are no parent slug's in links. I use last versions of plugin and GS. It is impossible to make sitemap correctly with i18n. Please, fix this.
Reply
#6
(2018-09-06, 16:24:01)vestris Wrote: Four years later problem is not soved. In sitemap.xml and in rss (i18n search plugin) there are no parent slug's in links.  I use last versions of plugin and GS. It is impossible to make sitemap correctly with i18n.  Please, fix this.

How about the following workaround: use the string %lang%/%slug% instead, omitting the %parent%, that should make the behavior the same for all languages.
That is, if the workaround doesn't introduce any name clashes...
Reply
#7
Yes, I did this on one of my sites. But for another project I need %parent% and something like... %parentparent%.
If my link is http://mysite.com/lang/parent1/parent2/page, why I do not see parent1's slug in sitemap.xml and rss?
It seems, GS and i18n have a trouble with this without changes in code. But I very need that changes.
Maybe somebody can help.
Reply
#8
The problem arises when the non-default language pages simply have no parent field (resp. it is empty), only the respective default language page has it. So it must be grabbed from there.

I did a little fix for this, for Getsimple 3.3 and plugin version 3.3.1.
Made a plugin that tries correcting the sitemap <loc> where parent is missing in the path.

Here is the plugin:
http://get-simple.info/extend/plugin/i18...-fix/1315/

Unfortunately, in order to use it, you have to edit the i18n base plugin source.
This is because the plugin uses the "sitemap" filter, which is not called by the plugin where it would be needed.
So you will have to add the call manually.

In sitemap.class.php, at the end of function generateSitemapWithoutPing, but before saving the $sitemap,
prepending "//create xml file", you will have to manually add the line
$xml = exec_filter('sitemap',$xml);

Then the source will look like that:

Code:
    }
    $xml = exec_filter('sitemap', $xml);
    //create xml file
    $file = GSROOTPATH .'sitemap.xml';
    XMLsave($xml, $file);
 }


There would also be the option to fix it directly in the i18n base plugin, without any external code.

But, as it is mvlcek's work, I am not sure whether he permits this. He has not been here for more than a year.
Reply




Users browsing this thread: 1 Guest(s)