How can I avoid duplicate content with TYPO3 v9 when having a news entry with multiple categories - typo3

I am working on a TYPO3 v10 LTS website with integration of the news extension v8.3.0. Many news are assigned to multiple categories and they are displayed on different detail pages according to their assigned categories. Now I would like to define one categories as master and use this category for the generation of canonical links to avoid duplicate content problems. On an older version of the website (TYPO3 v7 LTS) I used the solution explained here: https://www.typo3.net/forum/thematik/zeige/thema/116056/
I'm not so experienced with TYPO3 v9/v10 LTS yet, but I think that there must be a solution with routeEnhancers.
Any hints are welcome.

You need no route enhancer, just use the basic configuration of EXT:news.
one solution would be: for detail-view (show) always use one page. in this way each news will have a unique url. (problem: you can't ´return´ to the former list view with a hard link[1], as you don't know from which list you came)
2nd: configure a show-page with your news-categories: this page will be preferred for detail view (it always will be the first category) and each news will always be shown on this category detail page. (no ´return´ to the original list as above)
[1] you can't use a page as link target, but you can use javascript:history.back()

Related

TYPO3 tt_news - show hidden news

on TYPO3 with the tt_news extension, my contributors would like to previews news before publishing ; Problem : impossible to get a preview if the news is hidden. Our website is big and we can't display the news before to finish it, even for preview for a few seconds.
According to this documentation :
If a preview of hidden records needs to be allowed too, the checkbox
“Allow hidden records” needs to be checked in the plugin.
No way to find this checkbox.
Do you have any solution ?
According to the tt_news documentation, you have to set the following Page TSconfig:
tx_ttnews.singlePid = 37
where 37 is the UID of the page containing the single view plugin.
Apparently this functionality is currently broken:
https://forge.typo3.org/issues/67304
https://forge.typo3.org/issues/75768
The second issue on forge.typo3.org provides a possible solution which should work in general with all records of any extension (TYPO3 v7 and above!). Again, Page TSconfig (no TypoScript):
TCEMAIN.preview {
tt_news {
previewPageId = 37
useDefaultLanguageRecord = 0
fieldToParameterMap {
uid = tx_ttnews[tt_news]
}
}
}
I successfully tested this in TYPO3 v7. One major drawback – as already noted in your question – is that this does not work with hidden records.
Previewing hidden records result in the error message
no news_id given
Edit: As Bernd suggested, you could make use of categories to hide drafts of news records and use the preview solution above:
If you already use news categories: Set the category mode in the list view plugin(s) of tt_news to hide news records which do not own the desired categories. Let the editors assign the categories only if the content is ready.
Otherwise: use a new category preview – as Bernd suggested – and hide records with this category in the list view plugin.
The latter is a bit more risky to use for editors, as they could forget to set this temporary category. Nonetheless, you as an integrator could use the TSconfig TCAdefaults to automatically assign this preview category to all new records. The editors would only have to remove the category when the news record is completed.
Another possible workaround could be to save drafts in a separate folder which is not used by the list view plugin of tt_news. Then you also could use the preview solution above.
If that's not the right way of working for you or your editors, you could try using the workspaces extension which ships with the TYPO3 core.
a clean solution would be the usage of workspaces. but not all extension support it.
so another option would be to simulate workspaces:
build a page where your news can be seen and secure it with a login. so if only the new records should be shown you might create a 'preview' category, which is shown only on the special preview page.

TYPO3: tx_news: separate pagination between plugins

I'm using TYPO3 7.6 with the latest tx_news release from TER.
I want to show two news plugins at one page: one is configured to show all news from storage folder "A"; the other one is configured to show only the latest record from storage folder "B".
Now, once the first plugin paginates, the second one renders empty content since it tries to paginate as well (which doesn't make sense since it should display only the latest record).
So, my question is: How can I separate the pagination between both plugins?
In TYPO3 7.6 there is no solution to your issue, sorry. Workarounds include adding manual pagination for the second plugin or overriding the second widget with one that forces a different ID.
In TYPO3 8.6+ you can override the ID of each widget which causes the URL scope to change so you can isolate parameters for each widget. More information can be found on https://docs.typo3.org/typo3cms/extensions/core/8.7/Changelog/8.6/Feature-47006-ExtendTheWidgetIdentifierWithCustomString.html
I tweaked the fluid template to totally avoid the pagination in this case (based on "settings.templateLayout"
In the meantime (I don't know whether it was in place three years ago) there is an option Hide the pagination in the news plugin. You will find it in the tab Additional.
So if you place more than one list view on one page, you can disable pagination for all lists, which should not get paginated.

Map tt_news links to work with tx_news extension in TYPO3

I'm using tx_news with imported news entries from tt_news.
The import worked well, but some news contain "old" links in the body field of this form
/index.php?id=10&tx_ttnews[tt_news]=123&tx_ttnews[mode]=single&tx_ttnews[backPID]=2&no_cache=1
Can these links be "mapped" somehow to work with tx_news?
Using Typo3 7.6.12
In short, this is not possible. However there are several options I am thinking of. In general those links should be defined by using the EXT:linkhandler
1) Convert manually: Sounds sad but if not too many links are there, it is certainly the fastest one.
2) Use one of the hooks of TYPO3 which are used during the bootstrapping and do custom redirects. E.g. $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'].
3) Hook into the error handling and redirect right before showing any error page. One example to check out could be an ext I did: https://github.com/georgringer/fast_redirect. It must be certainly modified to fit your needs.
What you can actually do as well, which I did for a big import a while ago: Remove all news records again, truncate the table and use any PHP script and fill up the table tx_news_domain_model_newswith the same amount of news entries found in tt_news and set the uid to the one of tt_news and set the import_source field to TT_NEWS_IMPORT and the import_id field as well to the uid of the tt_news uid. After that, the import will pick the dummy tx_news_domain_model_news record, found by findOneByImportSourceAndImportId() and will enrich it with the regular data. You will end with news records having the same uid.

Looking for an Extension of an extensive link list

For the construction of an extensive list of links, since the source page is a thematic portal, I am looking for a suitable EXT., Which also runs under TYPO3 7.6 LTS.
it if the list of links to a permits the use of categories and multiple categorization of links is possible would be nice. should Weiterrhin the links are described not only the destination address and an alias but here should still an outline of the target page (possibly with photo) be possible.
Additional functions such as proposing links by users, reporting broken links or even a User Voting would nice additional features.
There were times the Modern Linklist, but they were no longer being developed for TYPO3 <6.x.
Is there perhaps somewhere an alternative or as one might like to vorhnandenen solutions might realize? It would be nice of course, without any programming knowledge, since I'm not a programmer.
P.S .: It is not about building a spam list but high quality links with topics relating to the original page.
As this seems to be a straight forward usage you could try to build that extension by yourself with the ExtensionBuilder.
just build up the records neccessary for your data. and let the EB generate all usefull actions: list & show, even create, edit, delete in FE would be possible.
Afterwards you just need to edit the generated fluid templates.
these links may help:
Overview
EB manual
small remark: if you want the newest code state, use the EB from git instead of TER
I`m not aware of an existing extension for it but it could be a good project to learn extbase / fluid.
You should also take a look at
typo3/sysext/fluid_styled_content/Resources/Private/Partials/Menu
and
typo3/sysext/fluid_styled_content/Classes/ViewHelpers/Menu
Fluid Content contains everything you need to create a list like that, you "just" have to combine the necessary bits and pieces.
You can do a lot with TYPO3 core functionality: there is a page type "external URL", pages can have categories by default, there are plenty of menu options (TypoScript HMENU, menu content elements, Fluid menu Viewhelpers). The Linkvalidator can periodically check all links and report broken links.
For suggestions you could add a form. Powermail for example can also store submitted info in database records, so your visitors could prepare page records (they are hidden until you make them visible).

How to manually order Typo3 news articles in the list view?

I am using the news plugin to simulate the classic page content elements but with previews. Now I would like to be able to manually set the order of the articles just as I would in the page module for the standard elements. But there seems to be no such option in the list module. How would I achieve such functionality?
There is an extension that adds a sorting field to tt_news so you can order the news entries in the list view. It has not been maintained for quite some time, but since it works on TCA and FlexForm level, it should still work with never versions. Check it out:
http://typo3.org/extensions/repository/view/mpossnewssorting