Jump to content
thirty bees forum
  • 0

Sitemap module now includes Blog (PANDA THEME)


rubben1985

Question

I asked to Panda developers to please modify the sitemap module so its blog module can be include in the sitemap generation (blogs are not included).

They sent me the modify file for official PS sitemap module (GSITEMAP). (I attach it)

I also modify the file so TB sitemap module can benefit from it. I am not developer but I think I did it correctly as It is working on my site right now.

If you have panda theme and you use its blog, this is helpful for SEO

Route for the files:

/modules/gsitemap/gsitemap.php (PS module)

/modules/sitemap/sitemap.php (TB module)

@lesley I am not sure if TB sitemap module include the official blog module or not. In case not, maybe you can use this code to support the official blog.

 

sitemap.rar

gsitemap.rar

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

Hi @rubben1985

First of all, thanks for your effort, it's really appreciated. Unfortunately, I don't think that these changes will make it into the sitemap module.

Why not? Because it introduces explicit dependency between modules. With this change, sitemap module now *magically* knows how to access *stblog* module's data. But only *stblog*. if we install any other blog module, then its data won't be accessible. Moreover, these changes access stblog module tables directly. That's just wrong, because it hardcodes information about other module's table structure. What if the author of stblog module release new version with different table structure? Such change would break this integration, and possibly bring down the whole shop.

We try hard to eliminate these kind of explicit dependencies from core, and core modules. And it's quite easy, that's what hooks are for. And sitemap module already executes hook named gSitemapAppendUrls. Any module that wants to append its data to generated xml file can register this hook, and use it to provide data during runtime. 

This is much safer. It is also standard hook (kind of). It's used by both sitemap and gsitemap modules, and it's already supported by number of blog (and other) modules. For example, standard tb blog module already uses this hook to provide data. 

I think the best way forward would be to contact stblog developer, and ask them to implement gSitemapAppendUrls hook. That will immediately make stblog module compatible with both sitemap and gsitemap modules, without any need for their modification.

Link to comment
Share on other sites

  • 0

Hi Rubben

Thanks for encountering this issue and getting a fix 🙂 I appreciate it, as we are planning to use Panda + Panda Blog + Sitemap.xml - I suspect that I was going to run into the same issue...
I haven't yet tested your solution, but I've downloaded and kept it for when I get to this point in development.

Thanks, I appreciate it big time actually 🙂 

  • Like 1
Link to comment
Share on other sites

  • 0

I have realized that in multistore there is an inconvenience: the sitemap shows articles and blog categories at every store so if you did not activate one article in a specific store, you get an error. I am already in contact with Panda technical service to fix this. It will be a paid solution, but I will share it with TB users 😉

  • Like 2
Link to comment
Share on other sites

  • 0

Hi @datakick I wrote @Jonny and here it is his answer:

Yes,  my changes were just for my blog modules,  if you are using any other blog modules, if there is the gSitemapAppendUrls hook in the module, that will add the links to the sitemap correctly. I will add the hook to my blog modules in the next update to be compatible with the sitemap module. but the CMS link duplicated issue need to modify the sitemap.php file to fix it.

As they support TB, maybe you can follow this topic internally?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...