Last updated September 10, 2009. Created by Dave Reid on July 1, 2009.
Edited by dbeall. Log in to edit this page.
Adding custom links, such as Views pages is only available in the 6.x-2.x version of the XML sitemap module.
Option 1:
- Enable the 6.x-2.x XML sitemap custom sub-module.
- Manually add the links to your views at admin/settings/xmlsitemap/custom
Option 2:
- Enable the 6.x-2.x XML sitemap menu sub-module.
- Create a new menu at admin/build/menu/add with the menu name xmlsitemap and title XML sitemap. Make sure that the 'Include this menu in the sitemap.' checkbox is selected.
- Edit your view's page view, and add the view to the 'XML sitemap' menu under the 'Page settings'.
Comments
how do you do this in drupal 7?
how can this be achieved in 7.x-2.x?
www.ferniesnowvalley.com
Drupal 7
The pathes are changed in Drupal 7
Option 1:
/admin/config/search/xmlsitemap/custom/add
Option 2:
/admin/config/search/xmlsitemap/settings
Views with pagination
How to add all paginated pages to the XML sitemap?
Drupal 7 and Views with Pagination
Just did this in Drupal 7. We had 13 pages of pagination, around 600 products to get into sitemap.xml.
The steps:
Thanks you for the
Thanks you for the information but I'm sorry, I think you are mistaken here...
As far as I know what you get with your instructions is your 600 articles listed in your xmlsitemap, not your views listing pages.
I don't know how to get /blog, /blog?page=2 /blog/page=3 ... to be included in the site map but the way you mention has nothing to do with this (AFAIK)
I'm not able to find any information about this...
Anyone out there?
any solution?
I agree with @neurojavi... anybody has a solution?
No solution right now
It is just a subscribe...
drupal+me are capable of: automotive community, jewelers portfolio
Maybe my tricky solution
Maybe my tricky solution would help someone. For views pages i've used hook in custom module, which automatically adds views pages to xmlsitemap on open. It uses xmlsitemap_custom module storage. These pages can be viewed in admin/config/search/xmlsitemap/custom. It is not good way, but it can be basic for further modification or as quick temporary solution.
<?php/**
* Implements hook_views_post_render().
*/
function MYMODULE_views_post_render(&$view, &$output, &$cache) {
if($view->name == 'display_products') {
$loc = '';
// you can get path here for your needs, it is specific to project. i'm using clean urls on views
if(substr($_GET['q'], 0, '8') == 'catalog/') $loc = $_GET['q'];
if(substr($_GET['q'], 0, '7') == 'catalog' && isset($_GET['page'])) $loc = 'catalog?' . $_SERVER['QUERY_STRING'];
if($loc) {
if (!db_query_range("SELECT 1 FROM {xmlsitemap} WHERE loc = :loc AND status = 1 AND access = 1 AND language = :language", 0, 1, array(':loc' => $loc, ':language' => LANGUAGE_NONE))->fetchField()) {
$link = array(
'type' => 'custom',
'loc' => $loc,
'id' => db_query("SELECT MAX(id) FROM {xmlsitemap} WHERE type = 'custom'")->fetchField() + 1,
);
xmlsitemap_link_save($link);
}
}
}
}
?>
Don't forget to add dependencies to module info file:
dependencies[] = xmlsitemapdependencies[] = xmlsitemap_custom
dependencies[] = views
Subscribing
Subscribing