Comments (8)
You still have to provide the data for sitemap: milesj.me/code/cakephp/utility#sitemap-generation
It doesn't just generate it.
from utility.
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.
Have you enabled routes?
CakePlugin::load('Utility', array('bootstrap' => true, 'routes' => true));
from utility.
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.
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.
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.
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.
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)
- Utility.Cacheable: Cache negative results HOT 3
- Enum: validation HOT 6
- Advanced Caching: pass $keys to callback HOT 7
- strict errors HOT 2
- Class 'Sanitize' not found
- Sitemap not working for me HOT 4
- Sitemap - error on line 1 at column 6: XML declaration allowed only at the start of the document HOT 11
- Composer installation instruction say: "mjohnson/utility": "1.5.*", HOT 1
- Sluggable _makeUnique is buggy HOT 8
- slugExists HOT 3
- FeedSource: always caching HOT 3
- This page contains the following errors: error on line 1 at column 1: Encoding error HOT 4
- Error in console panel for a website HOT 1
- Debug-level overridden HOT 2
- AutoLogin component might be causing incorrect 301 redirects HOT 3
- Ajax component can't handle responses bigger than 4096 HOT 12
- utility requires type-converter plugin without external code change HOT 3
- [Deprecated] Why? HOT 1
- Sluggable dynamic scope HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from utility.