Skip to content

Commit

Permalink
Merge pull request #76 from jonnitto/feature/noindexmixin
Browse files Browse the repository at this point in the history
FEATURE: Add NoindexMixin
  • Loading branch information
Sebobo committed Nov 13, 2018
2 parents 380f7f5 + 11374cf commit 7a939cb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/Fusion/XmlSitemapImplementation.php
Expand Up @@ -201,7 +201,7 @@ protected function resolveImages(NodeInterface $node, array &$item)
*/
protected function isDocumentNodeToBeIndexed(NodeInterface $node): bool
{
return !$node->getNodeType()->isOfType('Neos.Neos:Shortcut') && $node->isVisible()
return !$node->getNodeType()->isOfType('Neos.Seo:NoindexMixin') && $node->isVisible()
&& ($this->getRenderHiddenInIndex() || !$node->isHiddenInIndex()) && $node->isAccessible()
&& $node->getProperty('metaRobotsNoindex') !== true;
}
Expand Down
14 changes: 14 additions & 0 deletions Configuration/NodeTypes.Mixins.yaml
Expand Up @@ -74,6 +74,20 @@
group: 'seometa'
position: 40

#
# SEO Noindex tag mixin
#
'Neos.Seo:NoindexMixin':
abstract: true
properties:
metaRobotsNoindex:
defaultValue: true
ui:
inspector:
editorOptions:
disabled: true


#
# Twitter Card mixin
#
Expand Down
1 change: 1 addition & 0 deletions Configuration/NodeTypes.yaml
Expand Up @@ -21,6 +21,7 @@
superTypes:
'Neos.Seo:TitleTagMixin': false
'Neos.Seo:SeoMetaTagsMixin': false
'Neos.Seo:NoindexMixin': true
'Neos.Seo:TwitterCardMixin': false
'Neos.Seo:CanonicalLinkMixin': false
'Neos.Seo:OpenGraphMixin': false
Expand Down
5 changes: 5 additions & 0 deletions Documentation/index.rst
Expand Up @@ -108,6 +108,10 @@ To include contained images of pages in the xml sitemap use the following fusion
body.includeImageUrls = true
}

By default all shortcuts are ignored in the sitemap. They inherit from the prototype `Neos.Seo:NoindexMixin`.
If you have other document types that should not appear in the sitemap you can also let them inherit from
that prototype.

Alternate Language Tag
------------------------

Expand Down Expand Up @@ -194,6 +198,7 @@ enabled in the `Configuration/NodeTypes.yaml` file, along with an inspector tab:
superTypes:
'Neos.Seo:TitleTagMixin': false
'Neos.Seo:SeoMetaTagsMixin': false
'Neos.Seo:NoindexMixin': true
'Neos.Seo:TwitterCardMixin': false
'Neos.Seo:CanonicalLinkMixin': false
'Neos.Seo:OpenGraphMixin': false
Expand Down

0 comments on commit 7a939cb

Please sign in to comment.