Closed fritzmg closed 4 years ago
Well, this was an RFC, you shouldn't have merged it right away 😁. Are you fine with the canonical
tag functionality being gone?
We could implementate the canonical tag issue as an option in the module settings, can't we?
Definitely. And then add it via hook (since its gone from the module directly).
@fritzmg Which hook world you recommend?
parseArticles, because there you have the module instance as a third parameter and can thus simply check for
if ($module instanceof \Contao\ModuleNewsreader && …)
Prevent duplicate content by adding the canonical url into the head, if the correspondent field is selected in the module settings: https://github.com/markocupic/contao-news-infinite-scroll-bundle/commit/59eba56fa4d5c7737a65f1078008dc8687bbb04f
Currently, your newslist module does not extend from
\Contao\ModuleNewsList
. This leads to problems with thenewsListFetchItems
hook for example, as other app or extension developers will expect a\Contao\ModuleNewsList
object as the passed parameter.Furthermore, by extending from the existing
\Contao\ModuleNewsList
, you can reuse the majority of its functionality and only add the functionality that you actually need. Thus if there are any changes or improvements in thecontao/news-bundle
, your own module will automatically benefit from that.Also, to make this extension even more compatible with other existing newslist extensions, the palette can be changed via an
onload_callback
instead. This way, any changes to the originalnewslist
palette will be transported over to thenewslist_infinite_scroll
palette.However, this PR also removes the canonical tag functionality. Imho this should be part of a different extension, as this does not really have anything to do with the infinite scrolling functionality? And it should be implemented via a hook instead. Since this a backwards compatibility break, I labelled this PR as RFC, to discuss things further.