Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide reference to original content node when generating metadata #193

Closed
ianleeder opened this issue May 29, 2023 · 2 comments
Closed

Comments

@ianleeder
Copy link
Contributor

Same as issue #144, I would like to have access to the content node in the metadata notification events.

My use-case looks like something like this (our region handling is a hack, not the official way):

public void Handle(AfterMetaTagsNotification notification)
{
    // Handle region-specific metadata
    if(region is "NZ" &&
        !string.IsNullOrWhiteSpace(notification.Content.Value<string>("metaDataTitleNZ")))
    {
        notification.MetaTags.Title = notification.Content.Value<string>("metaDataTitleNZ");
    }
}

I have less concerns about performance on this than the sitemap: this is only storing the content object once, the sitemap notification event was potentially tracking hundreds of content objects.

@ianleeder
Copy link
Contributor Author

I'm migrating a legacy site that already has a lot of checkboxes for things like "Hide from sitemap", "MetaDataTitle", "ExcludeRobotsCrawl" etc. Although the correct way would be to use the native SeoToolkit settings for these, there are hundreds of pages. It's easier to hook into the metadata event and set the values based upon the content node, than it is to republish or migrate the content.

@patrickdemooij9
Copy link
Owner

And this one has also been released with the latest version! https://github.com/patrickdemooij9/SeoToolkit.Umbraco/releases/tag/3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants