Sitemapmadesimple and products module
-
- Forum Members
- Posts: 57
- Joined: Thu Jan 17, 2008 3:58 pm
Sitemapmadesimple and products module
Hi,
I am having some problems getting the xml sitemap to generate urls for products set up via the products manager.
How do I get it to include all of the links to my products? at the moment it just includes the page that calls the product module but not any of the product pages. Is it possible to include these?
Thanks
Rachael
I am having some problems getting the xml sitemap to generate urls for products set up via the products manager.
How do I get it to include all of the links to my products? at the moment it just includes the page that calls the product module but not any of the product pages. Is it possible to include these?
Thanks
Rachael
Re: Sitemapmadesimple and products module
Products "pages" are not the same as pages in content > pages...
-
- Forum Members
- Posts: 57
- Joined: Thu Jan 17, 2008 3:58 pm
Re: Sitemapmadesimple and products module
yes I know!
my question was in there a way to get them included in the xml file created by sitemap made simple.
at the moment I have made a UDT which gets all the products and creates the xml for them, this tag is then inserted into the sitemapmadesimple template. This work well but I was wondering if there was an easier way as it also does not include pages created by any other module like news or job etc
my question was in there a way to get them included in the xml file created by sitemap made simple.
at the moment I have made a UDT which gets all the products and creates the xml for them, this tag is then inserted into the sitemapmadesimple template. This work well but I was wondering if there was an easier way as it also does not include pages created by any other module like news or job etc
Re: Sitemapmadesimple and products module
did you ever find out how to do this?
-
- Forum Members
- Posts: 57
- Joined: Thu Jan 17, 2008 3:58 pm
Re: Sitemapmadesimple and products module
Hi,
sort of! I created a UDT to generate my own xml list of products and their URLs then put this in the template for the site map
so my site map template now looks like this
and my tag {googlexml} looks like this, I included a make alias function to make my urls pretty.
hope this helps
sort of! I created a UDT to generate my own xml list of products and their URLs then put this in the template for the site map
so my site map template now looks like this
Code: Select all
{* sitemap template *}
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
{foreach from=$output item='page'}
<url>
<loc>{$page->url}</loc>
<lastmod>{$page->date|date_format:"%Y-%m-%d"}</lastmod>
<priority>{$page->priority}</priority>
<changefreq>{$page->frequency}</changefreq>
</url>
{/foreach}
{googlexml}
</urlset>
Code: Select all
global $gCms;
$db = &$gCms->db;
function make_alias($string, $isForm=false)
{
$string = trim($string);
$string = preg_replace("/[_-\W]+/", "_", $string);
$string = trim($string, '_');
return strtolower($string);
}
$query = 'SELECT * FROM cms_module_products WHERE status="Published" ';
$result= $db->Execute($query);
while ($row= $result->FetchRow())
{
echo "<url>\r\n";
echo " <loc>http://www.domainname.org.uk/products/".$row['id']."/49/".make_alias($row['product_name'])."</loc>\r\n";
echo " <lastmod></lastmod>\r\n";
echo "<priority>0.7</priority>\r\n";
echo " <changefreq>weekly</changefreq>\r\n";
echo "</url>\r\n";
}
Re: Sitemapmadesimple and products module
i have done this. in the sitemapmadesimple admin area, the URLs appear in the info tab. however, they do not show up in mydomain.com/sitemap.xml
-
- Forum Members
- Posts: 57
- Joined: Thu Jan 17, 2008 3:58 pm
Re: Sitemapmadesimple and products module
try opening a page and saving it again. the sitemap.xml file only updates if a change is made to a page
-
- Forum Members
- Posts: 57
- Joined: Thu Jan 17, 2008 3:58 pm
Re: Sitemapmadesimple and products module
Sorry, i'm not sure what to suggest as this worked fine for me.
Re: Sitemapmadesimple and products module
hmmm this is a doozy. i'll have a good messaround and see what i can do.
otherwise is there a way of changing gsitemap.php to accomodate it?
http://dev.cmsmadesimple.org/project/files/166
otherwise is there a way of changing gsitemap.php to accomodate it?
http://dev.cmsmadesimple.org/project/files/166
Re: Sitemapmadesimple and products module
also, do you know how to add the hierarchy into the URL of the product. ie make
http://mydomain.com/products/1/23/product-in-question
to
http://mydomain.com/products/hierarchy/ ... n-question?
http://mydomain.com/products/1/23/product-in-question
to
http://mydomain.com/products/hierarchy/ ... n-question?
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Sitemapmadesimple and products module
Would take a code change. It's not part of the module atm.manc wrote: also, do you know how to add the hierarchy into the URL of the product. ie make
http://mydomain.com/products/1/23/product-in-question
to
http://mydomain.com/products/hierarchy/ ... n-question?
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.