Code Monkey home page Code Monkey logo

news_seo's Introduction

TYPO3 Extension news_seo

This extension provides additional SEO features to EXT:news

  • Fields robots_index & robots_follow to control robot information per article and to override robot information of the page record
  • Image preview information max-image-preview (documentation)
  • Set canonical tag even if no_index is set on page level
  • Field for a canonical link

Backend record

Requirements

  • PHP 7.4+
  • TYPO3 10/11/12 with core extension "seo" installed
  • EXT:news 8.6/9/10/11

Installation

Either use composer require georgringer/news-seo or install the extension via Extension Manager.

Usage

Exclude news from sitemap

Add the following snippet to your TypoScript

plugin.tx_seo.config.xmlSitemap.sitemaps {
    # Important: the key might differ in your setup!
    news {
        config.additionalWhere = {#type} NOT IN(1,2) AND {#robots_index}=1 AND {#canonical_link}=''
    }
}

Robots tag

The robots tag is automatically generated by the extension

Thanks

The initial development of this extension has been paid by MENNEKES Elektrotechnik GmbH & Co. KG - www.mennekes.de ❤️Thanks a lot!

news_seo's People

Contributors

georgringer avatar chesio avatar ste101 avatar serens avatar ursbraem avatar thomasrawiel avatar

Stargazers

Tobias Gläser avatar Volker avatar Josef Glatz avatar Ingo Fabbri avatar Oliver Klee avatar

Watchers

James Cloos avatar  avatar  avatar Tobias Gläser avatar  avatar

news_seo's Issues

Feature: Canonical URL for "reused" news in multisite installs

If you have a large TYPO3 multisite with minisites, a common use case is to reuse news across sites and domains (inside the same TYPO3).

In that case, it would be great to be able to determine the main location for a news.

Example:

  1. www.myassociation.org/news/some-thing -> That would be the detail view and the "canonical" appearance
  2. bern.myassociation.org/news/some-thing -> that would get a canonical tag pointing to (1)
  3. zurich.myassociation.org/news/some-thing -> that would get a canonical tag pointing to (1) as well

Is that already feasible? I guess not, as the source URL can't be fixed to a news record's canonical_link field in this case but would be depending on the context of the presentation.

Here's an idea

canonicalLinkForStoragePid {
       # Use the detail page 456 as canonical url for all records from 123
       123.detailPage = 456
       # Use the detail page 111 as canonical url for all records from 789
       789.detailPage = 111    
}

Not sure if it makes sense though or opens a can of worms

PHP Warning: Trying to access array offset on value of type bool

First of all, just for the record. We are still looking for the source of the (sporadic) error.

Core: Error handler (FE): PHP Warning: Trying to access array offset on value of type bool in /typo3conf/ext/news_seo/Classes/Utility/FetchUtility.php line 32

It seems as if a news is read out, but no longer exists and thus the query isNoIndex provokes an error. Perhaps a simple early return is sufficient.

news-seo: dev-main
TYPO3: 11.5

Undefined array key "robots_index" in /typo3conf/ext/news_seo/Classes/EventListener/ModifyHrefLangEventListener.php line 47

Just a small php warning.

Current:
if (!$this->getTypoScriptFrontendController()->page['robots_index']) { return; }

New:

$robotsIndex = $this->getTypoScriptFrontendController()->page['robots_index'];
 if (!isset($robotsIndex) || !$robotsIndex) {
    return;
}

Would this change be OK?
It would also have to be compatible with PHP 7.4. If everything is fine, I can take care of a PR.

Verison:
TYPO3 11
PHP 8.1
news_seo 2.0.1

Compatibility with news ^11.0

I assume ext:news_seo is still needed to provide robots index/follow for news records.

Will this extension be updated for news ^11.0 / TYPO3 12?

"require": {
    "php": ">= 7.4 < 8.3",
    "georgringer/news": "^8.6 || ^9 || ^10",
    "typo3/cms-seo": "^10.4 || ^11.5 || ^12"
  },

Edit: I just saw the latest commits, I guess there's just a tag missing?

Call to undefined method NewsAvailability::getNewsIdFromRequest()

We get the error "Oops, an error occurred!
Call to undefined method GeorgRinger\News\Seo\NewsAvailability::getNewsIdFromRequest()".

We use TYPO3 v. 10 with news 8.6.
The version called here is not present in news 8.6 and was implemented only with 9.1.

Call news_seo:

$newsAvailabilityChecker = GeneralUtility::makeInstance(NewsAvailability::class);

Method in news 9.1:
https://github.com/georgringer/news/blob/9.1.0/Classes/Seo/NewsAvailability.php#L128

Meta attribute max-image-preview

Gerne würden wir zu den jeweiligen Newsbeiträgen auch den Tag Meta-Tag "max-image-preview" um die Attribute "none, standard, large" erweitern können. Hier wäre ebenfalls die Abhängigkeit, dass bei noindex der der parameter "max-image-preview" nicht gesetzt wird.

Hintergrund ist, dass der Parameter eine Voraussetzung für Google-Discover ist. Also das eine News bei Chrome oder einen Android-Handy als Lesevorschlag unterbreitet wird

Question: What is the {#} Syntax in the readme?

In the readme, you write:

config.additionalWhere = {#type} NOT IN(1,2) AND {#robots_index}=1 AND {#canonical_link}=''

What is the {#type} syntax, should I use that or is it just a placeholder? I'd have set config.additionalWhere = type NOT IN(1,2) AND robots_index=1 AND canonical_link='' instead, but maybe that loses a feature?

PHP 7 compatibility < 7.4 (typed properties)

Hi Georg,

in php versions < 7.4 the typed class properties

protected TypoScriptFrontendController $typoScriptFrontendController;
protected PageRepository $pageRepository;

in class ModifyUrlForCanonicalTagEventListener
cause parse errors like
syntax error, unexpected 'TypoScriptFrontendController' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

Please consider adding PHP 7.4 as a minimum requirement (^7.4 || ^8.0) or remove the property types

no canonical tag if noindex

image

I tested your news_seo and found the following:
TYPO3 10.4.32, news 9.4.0, news 10.0
news-seo dev-main branch
Pre-test changes:
For the sitemap.xml I added the new no_index field additionalWhere = AND no_index = 0
The following assumptions were taken for this test:
The metatags are not changed via typoscript or fluid metatag viewhelper
metatags or hreflang/canonical are not manipulated except in core, news or news_seo
Result:
The no_index and no_follow fields work as expected.
The canonical url is correctly generated, but should not be rendered when no_index=1.
The news_seo extension fields have no influence on the generation of the hreflang tags. The generation of the hreflang tags depends only on the no_index setting of the detail page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.