2013-09-19, 06:00:23
(2013-09-19, 04:56:17)Carlos Wrote: NM does insert news posts in the Sitemap, but only if you still use GS 3.0 :-)
Since GS 3.1 sitemap hooks cannot be used by plugins like NM to insert their dynamic/non-page items in the Sitemap.
No easy way to fix this right now (mvlcek uses a clever workaround in his I18N plugin, but it's still not perfect)
Related threads:
http://get-simple.info/forums/showthread.php?tid=3056
http://get-simple.info/forums/showthread.php?tid=2624
Open issue: https://github.com/GetSimpleCMS/GetSimpleCMS/issues/363
I may create a simple plugin to generate an alternative Sitemap that includes NM posts, until this is fixed (when I have the time)
In the meantime, you can try patching GS as I suggested and manubz found, but in NM versions 2.2.6 or later you must also edit news_manager.php and change this:
by this:Code:if (!function_exists('generate_sitemap')) { // exclude GetSimple 3.1+
add_action('sitemap-additem', 'nm_sitemap_include');
}
Code:add_action('sitemap-additem', 'nm_sitemap_include');
Hi Carlos,
I tried your suggest like that, here is my generate_stemap function
Code:
function generate_sitemap() {
if(getDef('GSNOSITEMAP',true)) return;
// Variable settings
global $SITEURL;
[b][color=#FF0000]global $xml, $page;[/color][/b]
$path = GSDATAPAGESPATH;
$count="0";
$filenames = getFiles($path);
if (count($filenames) != 0) {
foreach ($filenames as $file) {
if ( isFile($file, $path, 'xml')) {
$data = getXML($path . $file);
if ($data->url != '404') {
$status = $data->menuStatus;
$pagesArray[$count]['url'] = $data->url;
$pagesArray[$count]['parent'] = $data->parent;
$pagesArray[$count]['date'] = $data->pubDate;
$pagesArray[$count]['private'] = $data->private;
$pagesArray[$count]['menuStatus'] = $data->menuStatus;
$count++;
}
}
}
}
And here is my news_manager.php : # hooks
Code:
# hooks
add_action('pages-sidebar', 'createSideMenu', array($thisfile, i18n_r('news_manager/PLUGIN_NAME')));
add_action('header', 'nm_header_include');
add_action('index-pretemplate', 'nm_frontend_init');
//add_filter('content', 'nm_site'); // deprecated
#if (!function_exists('generate_sitemap')) { // exclude GetSimple 3.1+
add_action('sitemap-additem', 'nm_sitemap_include');
#}
add_action('plugin-hook', 'nm_patch_plugin_management');
Am I false ?
Cheers.