TYPO3 : Adding plugin to page using the code - typo3

As a beginner with TYPO3 CMS in a new job, I had to make a new extension with differents plugins with a new table called "Products" and make the migration between the old products system and the newest one.
The goal of this was to adding automatically my plugin into the webpages using the code (no other solution, literally too much page to adding my plugin by hand).
I tried adding the reference of my plugin in the list_type field in my tt_content but unfortunately it doesn't work.
My question is: "Which fields I have to fill in in order to adding my plugin into my page?"

If you have been following common plugin registration your plugins will be in tt_content with CType: list and list_type: <extensionkey>_<pluginkey> (without any other underscores - for the linked example that would be exampleextension_list).
Some Background: TYPO3 (or rather TypoScript CONTENT, the base of all rendered content) then draws the rendering configuration from TypoScript setup in tt_content.list.20.<list_type>. In your case that will hold an entry point to render an Extbase action.
Required fields for your plugin in tt_content: pid, colPos, CType, list_type. If you used a Flexform for the plugin settings, also pi_flexform.
If you need something else, it is easiest to find out by adding your plugin via the backend and inspect the newly added DB record in tt_content afterwards.
Hints for debugging (I assume TYPO3 v9+):
Set TYPO3's application context to 'Development' by setting the environment variable TYPO3_CONTEXT=Development - this will show you the tt_content column names in the backend forms.
Set FE/debug = 1 (in LocalConfiguration.php or via InstallTool/Settings/Global Configuration) - this will show warnings in the frontend if your plugin configuration could not be found.

Related

HOWTO add new tab and fields to tx_news

Hi my problem is that I need to do a new extension depending on tx_news.
I want to add a TAB to the plugin options (after template tab) with some fields
I looked for the solution, but I can find only instruction to add a new field within the news record, but not for the plugin options.
typo3 v9.5 + tx_news v 7.x+
Until now there is no mechanism to add fields to the flexform definition which makes up the plugin options.
So you have to provide a complete flexform definition where you still use the old definition. that will break if the original extension changes it's flexform (and change something evidently).

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 7.2 Where to edit default templates + backend layouts?

Where do I edit default backend layouts that come with typo3 7.2 official introduction package? there is a table in the db that holds backend layouts but only those that I created, not the default ones. But where do I find the colPos layout for the default templates that already come with the installation? I only want to make slight modification in the html template and I'd like to make the changes editable from the backend.
Backend layouts are defined via PageTS below mod.web_layout.BackendLayouts.<key>. This is not a standard functionality, but a possibility provided by one of the integrated extensions.
The mapping of the backend layout ids to the template files is done in the actual TypoScript template at the path page.10.file.stdWrap.cObject.<key>.value.
For backend layouts created via the database, the key is the numeric id of the backend layout record.

How to add Typo3 Extensions to a page?

I googled for quite some time now and i cannot find a solution for such an easy beginner-problem.
I used the Typo3 Extension Builder to build a test-extension in Extbase. Now i want to use this and include it into one of my pages in the page tree structure to actually see if it works. When browsing the folder structure i can clearly see that the Domain model, the Controllers and all the views have properly been generated. But... How can i tell my page to include it and execute it?
I tried things like including the auto generated typescript into the templates of the pages but nothing works.
Thanks!
In Extension Builder make sure that you added "Frontend plugin" on the left pane. If you'll do it properly you will be able to add this plugin via CE "General Plugin" and then via field "Select plugin"
Sounds like you struggle on a more general level here.
In order to get the output of your Extension in the Frontend you have to assure the following steps:
Set up general Configuration, so that you can see the output of standard content elements in the frontend.
Install your extension and include its TypoScript.
Make sure you have a Plugin configured in your ext_localconf.php and registered in your ext_tables.php.
In the backend, create a new content element and choose "plugin" as its type.
Choose your registered plugin and save.
You should now see output of your extension in the frontend.

TYPO3 - HTML RTE frontend rendering is not working

I have the latest version of TYPO3, and the data I entered in the RTE is not rendered properly in the frond end (in site).
So for example <p>asdf</p> will show as it is in frond end.
I googled it and tried with some RTE default configuration changes, but that did not work well.
Please try with some basic testing first.
Create a new site on root level (directly below the globe). Create one content element with all text and styles you want to test.
Create a new Typoscript template for this site and put the following in the setup section:
page = PAGE
page.10 < styles.content.get
Make sure to include CSS Styled content inside the static template section.
Now watch your page page in frontend. Does it work?
Otherwise try step 0. and create a new (admin) backend user first.
Most likely you have either a strange transformation rule inside your RTE config in backend (UserTS or PageTS) or you have some kind of htmlspecialchar definition for your frontend rendering.
Please post something of the following basic Typo3 configuration settings and/or tell us if you use something of that:
You Upgraded from an older Typo3 version? Than it could be, that some configuration is missing.
Root Template or Site Template inside Typo3 Backend you can create or edit one, when you click in the most left menu on "Template"
If you choose "Create Template for new site" button the most basic Typo3 Typoscript * is automatically created
# Default PAGE object:
page = PAGE
page.10 = TEXT
page.10.value = HELLO WORLD!
Do you have such an TS (= Typoscript) tested? TEST IT and tell us if it works!!!
Does this work for you?
(Typo3's own configuration language - both a blessing and a curse - can be so easy and so painful - most laughful description i ever read, you can found on hatetypo3.blogspot.de "spaghetti code festival")
Don't miss include "CSS styled content" (it's in the form "edit whole template -> Includes)
But if you don't have include this, normally no site content is displayed in the frontend.
Another way is to include basic TS configuration in one or mor separate files. To get the files working, you have to referce them by this snippet in a Site Template in the BE
<INCLUDE_TYPOSCRIPT: source="FILE: yourfile">
# BTW I saw that it is common to place the file in a dir like
/fileadmin/ts/yourtyposcriptfile.ts
So give us this info or ask for more, if i miss something.