Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i18n, rss and sitemap.xml - no parent slug in links.
#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


Messages In This Thread
RE: i18n, rss and sitemap.xml - no parent slug in links. - by Knobbles - 2022-04-29, 04:19:17



Users browsing this thread: 1 Guest(s)