Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Small change request to google sitemap module


Go to End


6 Posts   1831 Views

Avatar
baba-papa

Community Member, 279 Posts

4 June 2011 at 10:09am

Edited: 04/06/2011 10:10am

Hello Ingo,

I really like Your google sitemap module. In combination with order SilverStripe measures like clean URL's sites easily rank on high positions without much effort.
For our ecommerce module SilverCart we need product detail pages to appear on the google sitemap. The thing is that our products are in fact DataObjects an not Pages. I had to decorate the function Items() of the class GoogleSitemap to make this work. I had to add the line

$this->extend("updateItems", $newPages);

after line 95 to make this function decorateable. I would be happy if You could add this line to the codebase so that I do not have to change core files.

Thanks,

Roland

Avatar
Willr

Forum Moderator, 5523 Posts

6 June 2011 at 3:36pm

Hi baba-papa,

The forum isn't the place to submit feature ideas as the module owner may not see your thread. You should submit patches as pull requests on the github project - https://github.com/silverstripe-labs/silverstripe-googlesitemaps.

updateItems may also be a bad name for the extension hook as it isn't clear thats for googlesitemaps. Perhaps a good enhancement to the module would be a GoogleSitemapableDecorator which you could apply to your dataobject (say forum posts as well) then in Items it would get a list of all the items with the decorator attached.

Patches welcome :)

Avatar
baba-papa

Community Member, 279 Posts

7 June 2011 at 3:49am

Hello Willr,
thanks for your reply. Sebastian and I did some changes to the GoogleSitemap module. It now can be used to show DataObjects that have an own link. With the help of a static method the class name of the DataObjects to add is defined.
We use Mercurial for code management and collaboration. I am not used to git hub and at the moment I'm too lazy to learn their command line syntax. How does a pull request work? Do I simply push to git://github.com/silverstripe-labs/silverstripe-googlesitemaps.git?

Best regards,

Roland

Avatar
Willr

Forum Moderator, 5523 Posts

7 June 2011 at 3:38pm

No, you cannot simply push to the official repos. Instructions for how to contribute are available http://doc.silverstripe.org/sapphire/en/misc/contributing#sending-pull-requests-for-git

If you wish, just submit a plain old diff patch file to open.ss and we can still merge it in the old skool way.

Avatar
baba-papa

Community Member, 279 Posts

7 June 2011 at 9:14pm

Hi willr,

thanks for your offer to do it the lazy way. I started learning git yesterday and now I am very ambiguous to do it the right way making a pull request. This might take a few days.

Avatar
baba-papa

Community Member, 279 Posts

8 June 2011 at 6:44am

Hi willr,
I tired to make the pull request by using the terminal. GIT terminal commands are too confusing to me and I did not like the tutorials. It took me 4 weeks to learn mercurial. I'm not willing to go through this again atm. I made the pull request via git's website form.
I may write a tutorial about how my changes work.