You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use a sitemap hook to be able to act whenever the sitemap is changed from the manager (so I can use it to update my search index with page hierarchy metadata). I added what I think is necessary, but am not seeing my hook being called. Can someone advise what is necessary to get this hook working?
In Startup, in Configure method, after App.Init(api) :
App.Hooks.OnGenerateSitemap += (sitemap) =>
{
// Add custom items to the sitemap before rendering Sitemap.xml
return ProcessUpdates(sitemap);
};
In Startup, my custom method :
public Sitemap ProcessUpdates(Sitemap sitemap)
{
int dbg = 1; // just so I can set the debugger here and inspect sitemap
return sitemap;
}
The debugger never stops in my ProcessUpdates method, when I update the sitemap in manager by dragging pages around, though I see "The sitemap was successfully updated" toast in manager.
The text was updated successfully, but these errors were encountered:
I think the hook for the sitemap works when someone requests the sitemap.xml file on the website. I don't think the hook fires from within the manager.
Hi @Markarend! Just like @r4g-jon wrote the hook you mention is actually for generating Google Sitemap, but I can see how the name is slightly confusing, we'll think about a future name-change to make it more clear.
For search-indexes there is a service API that you can implement called ISearch that you can find here:
This service gets called every time a page or post is updated or deleted. You can take a look at how we use this interface in our search module for Azure Search we're working on here:
Hakan, thank you very much for your quick reply, this will definitely help us!
Is there any service or event I can consume to be notified when the Piranha sitemap is updated by moving pages around on the manager?
I'm trying to use a sitemap hook to be able to act whenever the sitemap is changed from the manager (so I can use it to update my search index with page hierarchy metadata). I added what I think is necessary, but am not seeing my hook being called. Can someone advise what is necessary to get this hook working?
In Startup, in Configure method, after App.Init(api) :
In Startup, my custom method :
The debugger never stops in my ProcessUpdates method, when I update the sitemap in manager by dragging pages around, though I see "The sitemap was successfully updated" toast in manager.
The text was updated successfully, but these errors were encountered: