Map tt_news links to work with tx_news extension in TYPO3 - 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.

Related

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

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()

set a storagePid of pw_comments

Is it possible to set a storage PID where pw_comments also looks for comments instead only on the page where pw_comments is inserted?
Setting persistence.storagePid in Typoscript didn't help...
Background: I'm migrating comments from another extension to pw_comments but there the comments are stored mostly all in one folder. All the comments are belonging to news records. To figure out for any comment, which is the detail page where the news will be displayed, seems quite difficult.
It's possible to set/override the Storage Page where pw_comment should look for comments:
plugin.tx_pwcomments.settings.storagePid = 123
A possibility to look in several folders is not given.
you can use the EntryUid setting of pw_comments. Usually pw_comments works on page base.
But for EXT:news e.g. the detail page of any news is always the same and comments are stored in same folder/pid.
This option allows you to define a GET parameter (e.g. tx_news_pi1[news]) to be respected as separator for comments in same sys_folder.
So each time you are on news with e.g. uid=1, you just get the comments, because in comment record the field "entry_uid" has the value "1".
Here you'll find an example of how to configure typoscript: https://forge.typo3.org/projects/extension-pw_comments/wiki#How-to-use-pw_comments-with-other-extensions
Because the GET parameter is configurable, you can use pw_comments with any TYPO3 extension. Limitation: just one plugin per 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.

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

Converting content pages to tt_news (Typo3)

On a website, I have a section where I put a new page every week. I'd like to convert this to a system using tt_news. How do you suggest me to import the pages (more than 100 pages) to tt_news? Can I do it using a simple SQL query, or should I write a custom PHP script to perform the importation? Is there already an extension that exists that could help me performing this task?
It doesn't really matter to me if I simply build news liked to existing pages, or if I transfer the content of the page to the content of the news. It would be great if I can convert the page title to the news publish date, but I could use the page publishing date as well.
What do you suggest for performing this task?
I would do it via SQL as you mentioned already. Could get tricky if you have multiple content-elements per page that needs to be merged into one tt_news-dataset.
You could also install an extension, that links tt_content-elements with tt_news-records. This way you only have to insert the tt_news-records by traversing the pages and link the content per page to the new tt_news-record. Here are some extension, that link tt_news with content-elements:
ttnews_irre
aba_ttnews_content_con
Here is also an extension that could be worth a look: content2news.
Hope this is useful to you.
Best regards,
Peter