Giter Club home page Giter Club logo

Comments (8)

milesj avatar milesj commented on June 18, 2024

You still have to provide the data for sitemap: milesj.me/code/cakephp/utility#sitemap-generation

It doesn't just generate it.

from utility.

larry-tx avatar larry-tx commented on June 18, 2024

Do you mean something like this (found in my CollectionsController):

public function _generateSitemap() {
            $sitemap = array(
                array(
                    'loc' => array('controller' => 'collections', 'action' => 'index'),
                    'changefreq' => 'weekly',
                    'priority' => '0.5'
                )
            );
            if ($results = $this->Collection->find('all')) {
                foreach ($results as $result) {
                    $sitemap[] = array(
                        'loc' => array('controller' => 'collections', 'action' => 'view', $result['Collection']['slug']),
                        'lastmod' => $result['Collection']['modified'],
                        'changefreq' => 'weekly',
                        'priority' => '0.9',
                    );
                }
            }

            return $sitemap;

        }

from utility.

milesj avatar milesj commented on June 18, 2024

Have you enabled routes?

CakePlugin::load('Utility', array('bootstrap' => true, 'routes' => true));

from utility.

larry-tx avatar larry-tx commented on June 18, 2024

Here's what I've got;
In bootstrap.php:

CakePlugin::load( array( 'Autocache', array('routes' => TRUE), 'UrlCache', 'Users.Users', array('routes' => TRUE), 'Acl.Acl', array('bootstrap' => TRUE), 'Utils.Sluggable', 'ClearCache', 'AclExtras', // 'DebugKit', 'Upload', 'Utility', array('bootstrap' => TRUE, 'routes' => TRUE), ) ); In core.php: Configure::write('debug', 0);...require_once dirname(__DIR__) . '/Vendor/autoload.php'; In CollectionsController.php public function _generateSitemap() { $sitemap = array( array( 'loc' => array('controller' => 'collections', 'action' => 'index'), 'changefreq' => 'weekly', 'priority' => '0.5' ) ); if ($results = $this->Collection->find('all')) { foreach ($results as $result) { $sitemap[] = array( 'loc' => array('controller' => 'collections', 'action' => 'view', $result['Collection']['slug']), 'lastmod' => $result['Collection']['modified'], 'changefreq' => 'weekly', 'priority' => '0.9', ); } } return $sitemap; }

Larry E. Lutz
2425 Sage Road, Apt. 53
Houston, TX 77056
(713) 850-1358
[email protected]

Date: Tue, 28 May 2013 15:45:41 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [Utility] Sitemap returns nothing (#9)

Have you enabled routes?

CakePlugin::load('Utility', array('bootstrap' => true, 'routes' => true));


Reply to this email directly or view it on GitHub.

from utility.

milesj avatar milesj commented on June 18, 2024

CakePlugin::load() is being used incorrectly. Try this:

CakePlugin::load( array( 
    'Autocache' => array('routes' => TRUE), 
    'UrlCache', 
    'Users.Users' => array('routes' => TRUE), 
    'Acl.Acl' => array('bootstrap' => TRUE), 
    'Utils.Sluggable', 
    'ClearCache', 
    'AclExtras', 
    // 'DebugKit', 
    'Upload', 
    'Utility' => array('bootstrap' => TRUE, 'routes' => TRUE)
) );

from utility.

larry-tx avatar larry-tx commented on June 18, 2024

My bad, but unfortunately, even after changing the load directive as follows, sitemap still returns nothing:
CakePlugin::load( array( 'Autocache' => array('routes' => TRUE), 'UrlCache', 'Users.Users' => array('routes' => TRUE), 'Acl.Acl' => array('bootstrap' => TRUE), 'Utils.Sluggable', 'ClearCache', 'AclExtras', // 'DebugKit', 'Upload', 'Utility' => array('bootstrap' => TRUE, 'routes' => TRUE) ) );

Larry E. Lutz
2425 Sage Road, Apt. 53
Houston, TX 77056
(713) 850-1358
[email protected]

Date: Tue, 28 May 2013 17:10:43 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [Utility] Sitemap returns nothing (#9)

CakePlugin::load() is being used incorrectly. Try this:

CakePlugin::load( array(
'Autocache' => array('routes' => TRUE),
'UrlCache',
'Users.Users' => array('routes' => TRUE),
'Acl.Acl' => array('bootstrap' => TRUE),
'Utils.Sluggable',
'ClearCache',
'AclExtras',
// 'DebugKit',
'Upload',
'Utility' => array('bootstrap' => TRUE, 'routes' => TRUE)
) );


Reply to this email directly or view it on GitHub.

from utility.

milesj avatar milesj commented on June 18, 2024

I'm using the sitemap successfully in a few projects. I would suggest placing debug()s in your code and the Utility plugin to determine where the disconnect is.

From the looks of your opening post, it seems like a routing issue.

from utility.

larry-tx avatar larry-tx commented on June 18, 2024

Unfortunately, I have already spent far more than the time I budgeted to get a sitemap working. At this point, I'm afraid, we'll have to do without the sitemap part of SEO. If I ever have tons of spare time with nothing to do, I'll tackle debugging it.

Larry E. Lutz
2425 Sage Road, Apt. 53
Houston, TX 77056
(713) 850-1358
[email protected]

Date: Tue, 28 May 2013 21:31:36 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [Utility] Sitemap returns nothing (#9)

I'm using the sitemap successfully in a few projects. I would suggest placing debug()s in your code and the Utility plugin to determine where the disconnect is.

From the looks of your opening post, it seems like a routing issue.


Reply to this email directly or view it on GitHub.

from utility.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.