Why can't I find the sitemap to edit? >:( I am running V.0.7.9
Cheers
First: You'll get better support for 0.7.9 in the new OpenCart Zero forums (i wish daniel would lock this board)
Second: Sitemap is autogenerated. But you can change the code in catalog/controller/sitemap.php or the template in catalog/template/default/content/sitemap.tpl
Second: Sitemap is autogenerated. But you can change the code in catalog/controller/sitemap.php or the template in catalog/template/default/content/sitemap.tpl
Thanks Q
Apparently I have a space at the top of the page which is causing an Xml error. I have found both files you mention but don't see how to fix fix the error.
http://www.capoeiracanal.co.uk/capoeira ... =g_sitemap
Apparently I have a space at the top of the page which is causing an Xml error. I have found both files you mention but don't see how to fix fix the error.
http://www.capoeiracanal.co.uk/capoeira ... =g_sitemap
The XML declaration MUST be in the first line of an document. Maybe that breaks the page (as things are more strict there).
With the DOCTYPE it's not that strict, most browsers just ignore the declaration if it's not on the first line (which is most likely unwanted too since it triggers Quirks mode).
XHTML is a bit of overkill anyay, why not use HTML 4.01? It's an interesting subject. Valid XHTML 1.0 code is actually invalid HTML 4.01 - the MIME-type decides how a document gets served. If it's sent as text/html, it gets treated as HTML (probably 99% of websites). IE 6.0 doesn't even know application/xhtml+xml.
I always use the following for new documents, that's enough:
With the DOCTYPE it's not that strict, most browsers just ignore the declaration if it's not on the first line (which is most likely unwanted too since it triggers Quirks mode).
XHTML is a bit of overkill anyay, why not use HTML 4.01? It's an interesting subject. Valid XHTML 1.0 code is actually invalid HTML 4.01 - the MIME-type decides how a document gets served. If it's sent as text/html, it gets treated as HTML (probably 99% of websites). IE 6.0 doesn't even know application/xhtml+xml.
I always use the following for new documents, that's enough:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Here is my g_sitemap, can anyone advise on how to fix the error.
Code: Select all
<?php
class ControllerGSitemap extends Controller {
function index() {
$module =& $this->locator->get('module');
$response =& $this->locator->get('response');
$template =& $this->locator->get('template');
$url =& $this->locator->get('url');
$config =& $this->locator->get('config');
$database =& $this->locator->get('database');
$language =& $this->locator->get('language');
$image =& $this->locator->get('image');
//Google Sitemaps addon for karzina!
// Base URL
if (@$_SERVER['HTTPS'] != 'on') {
$catalog_url = HTTP_SERVER;
$image_url = HTTP_IMAGE;
} else {
$catalog_url = HTTPS_SERVER;
$image_url = HTTPS_IMAGE;
}
//Output XML
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
//Add the Home Page
echo '<url>' . "\n";
echo '<loc>' . $catalog_url . '</loc>' . "\n";
echo '<changefreq>weekly</changefreq>' . "\n";
echo '<priority>1.0</priority>' . "\n";
echo '</url>' . "\n";
if ($config->get('config_url_alias')) {
//Get all URL's in the site!
$sql = "select `alias` from `url_alias`";
$results = $database->getRows($sql);
foreach($results as $result) {
$page = $result['alias'];
//Static Page - Store Home
echo '<url>' . "\n";
echo '<loc>' . $catalog_url . $page . '</loc>' . "\n";
echo '<changefreq>weekly</changefreq>' . "\n";
echo '<priority>0.9</priority>' . "\n";
echo '</url>' . "\n";
}
}
else {
//Get all URL's in the site!
$sql = "select `query` from `url_alias`";
$results = $database->getRows($sql);
foreach($results as $result) {
$page = $result['query'];
//Static Page - Store Home
echo '<url>' . "\n";
echo '<loc>' . $catalog_url . 'index.php?' . $page . '</loc>' . "\n";
echo '<changefreq>weekly</changefreq>' . "\n";
echo '<priority>0.8</priority>' . "\n";
echo '</url>' . "\n";
}
}
echo '</urlset>';
}
}
?>
Thanks!
Who is online
Users browsing this forum: No registered users and 11 guests