Call-back icon  Enterprise Sales: +1.310.775.2674 (N. America)   +44 20.3286.4137 (UK)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Page 1 of 4
Generate Google Sitemaps
 
dev722z
Member
 
Total Posts:  60
Joined:  2008-04-09
 

Hi,

1- Generate sitemaps with admin URL

Configure:
System > Configuration > Google Sitemap

Create sitmap(s) in :
Catalog > Google Sitemap

To generate sitemap with id 1:
admin/sitemap/generate/sitemap_id/1

2- Add an actions dropdown list to backend

warning: it is not recommended to modify core files

In file app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php,just before :

return parent::_prepareColumns();
add:
#722z---------->
# add action dropdown
        $this->addColumn('action', array(
            
'header'    =>  Mage::helper('sitemap')->__('Action'),
            
'filter'    =>    false,
            
'sortable'    =>    false,
            
'width'        => '100px',
            
'renderer'    =>    'adminhtml/sitemap_grid_renderer_action'
        
));
#-------------->

Add this file app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * @category   Mage
 * @package    Mage_Adminhtml
 * @copyright  Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/**
 * Adminhtml sitemap grid block action item renderer
 *
 * @category   Mage
 * @package    Mage_Adminhtml
 * @author      722z
 */

class Mage_Adminhtml_Block_Sitemap_Grid_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
{
    
public function render(Varien_Object $row)
    
{
        $actions 
= array();

        
$path ltrim($row->getSitemapPath(), '/');
        
$path rtrim($path'/');
        
$link Mage::getBaseUrl('web') . $path '/' $row->getSitemapFilename();
        
$actions[] = array(
            
'url'        =>    $link,
            
'caption'   =>  Mage::helper('sitemap')->__('Preview'),
            
'popup'        =>    true
        
);

        
$actions[] = array(
            
'url'        =>    $this->getUrl('*/sitemap/generate',array('sitemap_id'=>$row->getSitemapId())),
            
'confirm'    =>    Mage::helper('sitemap')->__('Do you really want to generate this sitemap?'),
            
'caption'   =>  Mage::helper('sitemap')->__('Generate'),
        );

        
$this->getColumn()->setActions($actions);
        return 
parent::render($row);
    
}

}

3- Automatize

Configure Magento crontab in:
System > Configuration > System > Crontab

Configure cron for Google Sitemap :
System > Configuration > Google Sitemap

Configure crontab on your server with something like this:

*/* * * * /absolute/path/to/php5 -/absolute/path/to/magento/cron.php

dev722z

 
Magento Community Magento Community
Magento Community
Magento Community
 
Right Click
Sr. Member
 
Avatar
Total Posts:  154
Joined:  2008-04-16
Roma
 

But, where is Varien ‘???? Magento must have this foundamental things !!!!

 Signature 

- Creazione e personalizzazione Ecommerce Magento
- Hosting ottimizzato per Magento
- Template grafici magento
- Moduli Magento
_________________________________________________________
http://www.ecommerce-store.it - Hosting - Template e Moduli per Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
Smokersroom
Member
 
Total Posts:  56
Joined:  2007-09-04
 

Thamks for your help. I’ll give this a try.

I do have to agree with Right Click - This is one hell of an oversight in an otherwise superb piece of software.

S.

 Signature 

Buy Watches Online

 
Magento Community Magento Community
Magento Community
Magento Community
 
Smokersroom
Member
 
Total Posts:  56
Joined:  2007-09-04
 

It works, thanks!!

S.

 Signature 

Buy Watches Online

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andrey666
Jr. Member
 
Total Posts:  21
Joined:  2008-04-16
 

most helpfull post in forums by far… great work dev722z thanx

 
Magento Community Magento Community
Magento Community
Magento Community
 
ryanb
Sr. Member
 
Total Posts:  91
Joined:  2008-02-15
 

I did this and I’m getting a:
Forbidden
You don’t have permission to access /report/ on this server.

Any suggestions? Perhaps my permissions are set to strictly

 
Magento Community Magento Community
Magento Community
Magento Community
 
mytechfactory
Sr. Member
 
Avatar
Total Posts:  78
Joined:  2007-12-27
New York, NY
 

Set your sitemap path relative to your domain name
navigate to Catalog > Goog Sitemap > Add Sitemap

Filename: sitemap.xml
Path: /
Store View: (your choice of store view)

 Signature 

To Be Magento’d
http://www.mytechfactory.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
ryanb
Sr. Member
 
Total Posts:  91
Joined:  2008-02-15
 

Got it working! I am worried that I will go over the 50,000 URL limit.

We have 20,000 products in our store, but will be adding even more.

BTW—I love snoopy!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ata Asgari
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2008-04-16
Dubai, UAE
 

It’s not working for me :(

Error WarningInvalid argument supplied for foreach()
Trace:
#0 /home/rave/public_html/app/code/core/Mage/Sitemap/Model/Sitemap.php(80): mageCoreErrorHandler(2, 'Invalid argumen...', '/home/rave/pub...', 80, Array)
#1 /home/rave/public_html/app/code/core/Mage/Adminhtml/controllers/SitemapController.php(206): Mage_Sitemap_Model_Sitemap->generateXml()
#2 /home/rave/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(342): Mage_Adminhtml_SitemapController->generateAction()
#3 /home/rave/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php(148): Mage_Core_Controller_Varien_Action->dispatch('generate')
#4 /home/rave/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(146): Mage_Core_Controller_Varien_Router_Admin->match(Object(Mage_Core_Controller_Request_Http))
#5 /home/rave/public_html/app/Mage.php(427): Mage_Core_Controller_Varien_Front->dispatch()
#6 /home/rave/public_html/index.php(40): Mage::run()
#7 {main}
I think it’s related to latest version of php.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1771
Joined:  2007-08-07
Los Angeles
 

@Ata: do you see any categories in your store top nav?

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ata Asgari
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2008-04-16
Dubai, UAE
 
Moshe - 28 May 2008 08:55 AM

@Ata: do you see any categories in your store top nav?

No, I’m using default skin, is it related to php version as well?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1771
Joined:  2007-08-07
Los Angeles
 

Did you follow this wiki?
http://www.magentocommerce.com/wiki/how-to/how_to_create_new_categories_in_magento

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
 
uvfch
Jr. Member
 
Total Posts:  5
Joined:  2008-04-04
 

Hi, a follow questiong re. sitemap:

for different storeview, do I need to create 2 google sitemaps?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Princeanil
Jr. Member
 
Total Posts:  28
Joined:  2008-05-06
 

Ok i’ve been able to get the sitemap generated using this. Just one problem -

If i use only / in the path in Catalog -> Google Sitemap , it doesnt work. Instead of http://www.mystore.com/sitemap.xml, it tries to create http://www.mystore.com//sitemap.xml - notice the double /

If i use anything else in the path, like map/ , then it works and creates http://www.mystore.com/map/sitemap.xml

 Signature 

Anil

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andrey666
Jr. Member
 
Total Posts:  21
Joined:  2008-04-16
 

leave the path field blank (to avoid double //) for http://www.mystore.com/sitemap.xml

 
Magento Community Magento Community
Magento Community
Magento Community
 
Princeanil
Jr. Member
 
Total Posts:  28
Joined:  2008-05-06
 

It doesn’t allow a blank . You need to type something in it.

 Signature 

Anil

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 4
 
© Copyright 2009 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
108669 users|406 users currently online|199749 forum posts