Typo3 create reference element for all subpages - typo3

I have a TYPO3 8.7.
I need an element (plugin) to be displayed for all subpages.
I found such solutions:
1) Create element reference But I do not know how to add it simply on all pages?
2) Add plugin on every pages But is it possible to copy exactly my plugin installed on the page ?

Both approaches are suboptimal, since you either had to create a reference content record on each page or your plugin would not be configured manually anymore.
My recommendation would be to put that particular plugin into a specific column of the root page and inherit the content of that column via the "slide" feature of the CONTENT cObject:
https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Content/Index.html#slide
We are using this feature i.e. for the whole footer section of https://coders.care including the twitter plugin and the random testimonial content.

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

How to prevent tx_news plugin render single view for arbitrary news records?

I have a page with multiple news plugins. Each plugin should only render news list and single view for a given category. This is accomplished via "Single-view page for news from this category" and the TyposScript setting detailPidDetermination. Furthermore I have plugins with "List of selected items". This all works fine.
Now my problem: I have no clue how that could happen, but Google has now some news twice in the index. Once with the correct path to the single view and once with the path to any other plugin. This leads to duplicate content problems.
So it seems that any news plugin can render the single view for any record. Is there any way to prevent that? Especially when I use the plugin with "List of selected items", I expect it to render list and single view only for those selected records.
TYPO3 8.7
EXT:news 7.3.1
The only optional check is currently for the storage pid which can be enabled with settings.detail.checkPidOfNewsRecord = 1.
If you need further checks you need to use the signalSlot detailAction. However it will be very hard to know on the detail page if this news record is allowed or not as the detail view knows nothing from the list plugin.

How to remove an entry out of $GLOBALS['TCA'] (Table configuration array) in the Backend in TYPO3

I want to remove an entry in the select field in the plugins section of TYPO3. Basically where on can pick the list_type. I'd like to remove one. When I open the Configuration in the TYPO3 backend I see that all the configured extensions listed in:
$GLOBALS['TCA']['tt_content']['columns']['list_type']['config']['items']
But how can I remove an entry of this array now in my Editor (PhpStorm)? I can't find the entries in the TCA/Overrides/tt_content...
Any help or hints are appreciated!
Best
If you want to remove content element types (Ctypes) for editors, you could use Page TSConfig or User TSConfig. Add this to your backend user group or to the page (in the page properties Resources / Page TSConfig):
TCEFORM.tt_content.CType.removeItems := addToList(textpic,bullets,table,uploads)
This removes the element "textpic,bullets,table,uploads" in the backend for tt_content records.
TCEFORM.tt_content.list_type.removeItems := addToList(my_pi1,my_pi2)
But in addition to this you should also study the documentation for MOD pageTSconfig, specifically the section about the new content wizard. Remember that removing an empty from TCA is far, far from enough to remove the corresponding meta configuration from all places. You will also create pageTSconfig and TypoScript setup by registering a plugin and this setup may also need to be removed.
https://docs.typo3.org/typo3cms/TSconfigReference/8.7/PageTsconfig/Mod/Index.html#new-content-element-wizard-mod-wizards-newcontentelement
The easiest way if this is one of your own plugins and you don't need it at all: avoid registering it. One way to do so is to make a condition for whether or not to register the plugin and control this with a toggle (ENV, context, extension config, etc.)
When you register a plugin in TYPO3 it creates quite a bit of configuration in addition to adding the items to either the CType or list_type selectors depending on registration method. This other configuration is as important as the TCA item.

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.

TYPO3 Plugin: ways to insert on a page

Is it possible to insert a frontend plugin to a page without having a template (and markers) included?
Normally I use:
10.marks {
CONTENT_LEFT < plugin.tx_xy_p1
}
But in a new project I dont want to have a template file where the markers (###CONTENT_LEFT###) are included. The plugin should appear as the only thing on that page.
If all you want is the plugin, simply create a sparkingly fresh root template with the standard page object of type PAGE, and insert plugin content there.
Create a new page with rootflag etc, and maybe the static files for your plugin, if needed. In the setup field enter your adaption of this:
page = PAGE
page.10 < plugin.tt_news
You might of course need to add more, depending on your needs, but this should be the principle (and it works, I tested just now). :-)