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

BUGFIX: Exclude shortcuts from XML sitemap #35

Merged
merged 1 commit into from
May 24, 2017

Conversation

kdambekalns
Copy link
Member

When shortcuts are included in the XML sitemap, that may lead to
invalid sitemap entries: If a shortcut points to an external URL,
it violates the XML sitemap protocol.

@kdambekalns kdambekalns self-assigned this May 9, 2017
@kdambekalns kdambekalns requested a review from kitsunet May 9, 2017 08:18
@kdambekalns
Copy link
Member Author

This is one way to fix that… we could avoid adding a new property (and the need for a node:repair to populate it) by at least two variants

  • checking for the node type in the sitemap template, but that seems "too hardcoded"
  • adding a new mixin to exclude shortcuts from the XML sitemap

What is the way to go?

@kdambekalns
Copy link
Member Author

/cc @TheLalaMan

@aertmann
Copy link
Contributor

aertmann commented May 9, 2017

not really an optimal way to solve the issue, even though the feature isn't such a bad idea in itself

how about just skipping shortcuts all together in the sitemap? internal shortcuts would just point to another node anyway, thus unnecessary

should be doable by setting a filter property with value Neos.Neos:Document, !Neos.Neos:Shortcut of the Menu in https://github.com/neos/neos-seo/blob/master/Resources/Private/Fusion/Root.fusion#L214

@kdambekalns
Copy link
Member Author

Heck, this is a way better solution, thanks @aertmann. I felt like I was missing something obvious ;)

@kdambekalns kdambekalns changed the base branch from master to 1.0 May 11, 2017 14:36
@kdambekalns
Copy link
Member Author

That worked for me… :)

@kdambekalns
Copy link
Member Author

No, this does not work as expected, I was too quick with my testing. With this filter, all children of a shortcut node will be skipped as well, thus making whole sections of a website disappear…

When shortcuts are included in the XML sitemap, that may lead to
invalid sitemap entries: If a shortcut points to an external URL,
it violates the XML sitemap protocol.

Setting the filter property of the used Menu object to exclude Shortcuts
does not work as expected, as it would exclude children of those nodes
as well.

Thus a check in the XML template is used.
@aertmann
Copy link
Contributor

good catch

@kdambekalns
Copy link
Member Author

Now with an if in the template…

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

Successfully merging this pull request may close these issues.

2 participants