TYPO3 (10.4) Felogin: Can´t change Template - typo3

i can´t change the Login.html template from the EXT:Felogin (10.4.4) in my TYPO3 (10.4.4 latest).
I tried everything.
I changed the path with typoscript in:
Backend (constants and setup)
In my sitepackage (constants and setup)
I even changed the path in the original extension in typo3/sysext/felogin
and nothing worked for me.
Did anybody managed it to changed the template?

In my case in Typo 10.4.6 (own Sitepackage = ***) this Setup works:
SETUP:
plugin.tx_felogin_login {
view {
templateRootPaths.10 = EXT:***/Resources_felogin/Private/Templates/
partialRootPaths.10 = EXT:***/Resources_felogin/Private/Partials/
}
}
Now i can edit Login.html

First it has to be verified which kind of template is used, as since TYPO3 version 10.2 there exist two different plugins and templates:
The old-style template which is using markers in the form ###MARKER###.
This template relies on the old plugin which is still based on piBase
The new fluid-based template is served by the new plugin which is based on extbase.
The switch between these two options is quite uncommon in the feature-settings resided, which can be found here:
The fe_login-setting I found in the very bottom of the modal-window which is opening after having clicked on the button "Feature Toggle":
If the button is activated and therefore shown green fluid-templates are used, else the old marker-template.
It still keeps to mention that the new plugin with fluid-templates inside the extension fe_login is not mentioned in the current official documentation but only in this CHANGELOG
Below I will show the solutions for fluid-templates.
Settings for Fluid-Templates
Enable fluid-templates like explained above if not done yet.
Add the TypoScript shown after the following image if it's missing (you can control it in the Template-Tools for TypoScript:
Take care that you have to switch there between constants and setup to find the correct values if existing.
TypoScript Constants:
plugin {
tx_felogin_login {
view {
# cat=Frontend Login/02_Template/102; type=string; label= Path to template root (FE)
templateRootPath = EXT:felogin/Resources/Private/Templates/
# cat=Frontend Login/02_Template/103; type=string; label= Path to template partials (FE)
partialRootPath = EXT:felogin/Resources/Private/Partials/
# cat=Frontend Login/02_Template/104; type=string; label= Path to template layouts (FE)
layoutRootPath = EXT:felogin/Resources/Private/Layouts/
}
}
}
TypoScript Setup:
plugin.tx_felogin_login {
view {
templateRootPaths {
0 = EXT:felogin/Resources/Private/Templates/
10 = {$plugin.tx_felogin_login.view.templateRootPath}
}
partialRootPaths {
0 = EXT:felogin/Resources/Private/Partials/
10 = {$plugin.tx_felogin_login.view.partialRootPath}
}
layoutRootPaths {
0 = EXT:felogin/Resources/Private/Layouts/
10 = {$plugin.tx_felogin_login.view.layoutRootPath}
}
}
}
tt_content.login < tt_content.felogin_login
Save the record or the files, depending where you added the TypoScript and afterwards in the Template-Tools you can open the constant-editor to add your own values there.
Check the paths and adjust them to your needs. A copy of the fluid-files has naturally to exist in the paths that are entered in the form. They can be adjusted later, but it's advisable to add a headline or some other text for testing if the templates are taken from the right directory.
After clearing the cache the website can be reloaded for controlling if the steps succeeded. If the original templates are shown check all paths and if the templates reside without changes perhaps already in the right directories, just in original form. If nothing or only the headline is shown check if you added a plugin of type login-form and add it on the right page and in the right col if missing.
It has to be expected that in TYPO3 version 10.4.5 or later everything is much easier and some steps here are just not required, like adding the TypoScript-Snippets - they will probably soon reside in the original setup for the extension.

It works here in a 10.4.3 installation:
TS (Setup):
plugin.tx_felogin_login {
view {
templateRootPaths.10 = EXT:sitepackage/Resources/Private/FeLogin/Templates
partialRootPaths.10 = EXT:sitepackage/Resources/Private/FeLogin/Partials
}
}
And place your file in
sitepackage/Resources/Private/FeLogin/Templates/Login/Login.html

The following answer is not correct but includes some links that might be of interest. For a step-by-step-description look for my second answer on this page.
That seems being broken for me in the moment, I tried it out like you without success.
If an individual file-path is entered, the original template is not loaded anymore but the configured file neither.
I found two issues in the bugtracker that seem somewhow related:
Bug #90953: Add missing view path definition for felogin
Task #90566: Provide examples of how to customize / extend the extbase plugin
Its possible that there are still other issues reported related to it, but I never found any on a quick search. First step would be to search here:
Forge issues, category fe_login
second step would be to rermove or change the search filter.
Finally you still can file a new issue, even without searching too much, it doesn't matter much if an issue is reported twice.

Look here. https://review.typo3.org/c/Packages/TYPO3.CMS/+/64080
Add this to your constants and setup override for felogin.
Works totally fine for me in TYPO3 10.4.9
Constants
plugin.tx_felogin_login {
view {
# cat=Frontend Login/02_Template/102; type=string; label= Path to template root (FE)
templateRootPath = EXT:providerExt/Resources/Private/Templates/FeLogin/
# cat=Frontend Login/02_Template/103; type=string; label= Path to template partials (FE)
partialRootPath = EXT:providerExt/Resources/Private/Partials/FeLogin/
# cat=Frontend Login/02_Template/104; type=string; label= Path to template layouts (FE)
layoutRootPath = EXT:providerExt/Resources/Private/Layouts/FeLogin/
}
}
Setup
plugin.tx_felogin_login {
view {
templateRootPaths.10 = {$plugin.tx_felogin_login.view.templateRootPath}
partialRootPaths.10 = {$plugin.tx_felogin_login.view.partialRootPath}
layoutRootPaths.10 = {$plugin.tx_felogin_login.view.layoutRootPath}
}
}
Path to Login.html Override in Template Folder
providerExt/Resources/Private/Templates/FeLogin/Login/Login.html

Related

Add a static template to my typo3 extension

I have created an extension with sitepackagebuilder.com and the idea is just to write some static html.
I know that when you have a controller you can call the templates by following the convention names. But what if you don't have a controller? What I need, at least for now, is just to install the extension, add the plugin into a page and get some static content in that page.
I can imagine that this is set in a typoscript file but I'm quite noob with all the typoscript thing.
I'm getting this error:
'No Content Object definition found at TypoScript object path "tt_content.list.20.heboorganigram_organigram"'
Until I define that object in my typoscript file. I have tried this.
tt_content.list.20.heboorganigram_organigram = PAGE
tt_content.list.20.heboorganigram_organigram.10 = TEMPLATE //(or FLUIDTEMPLATE same result)
tt_content.list.20.heboorganigram_organigram.10.template = FILE
tt_content.list.20.heboorganigram_organigram.10.template.file = fileadmin/Organigram.html
And then I don't get an error but I also don't get the content from my Organigram.html, this is just trying stuffs, I actually don't know if this is what I need to do.
Before creating new Content Elements you first have to create the Page Template, for that have a look at the sitepackage tutorial https://docs.typo3.org/m/typo3/tutorial-sitepackage/master/en-us/FluidTemplates/Index.html
If you already got the page template, have a look at https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/ContentElements/AddingYourOwnContentElements.html
Provided you already did the steps above, for getting the frontend output you are interested in the step Configure the frontend rendering
So the TypoScript should look something like this:
lib.contentElement {
templateRootPaths.200 = EXT:heboorganigram/Resources/Private/Templates/
}
tt_content {
examples_newcontentelement =< lib.contentElement
examples_newcontentelement {
templateName = NewContentElement
}
}
Then you need to place your Organigram.html file in the Templates Folder in inside the sitepackage.

setup.txt / setup.typoscript not being loaded in module

I'm writing an extensio in Typo3 9.5 and I can't get the setup.txt or setup.typoscript to load.
I am trying to add a second page type that renders only JSON. For that I gather I need to change the typoscript. Therefore I added this code to my setup.typoscript:
ajax_ajaxjson = PAGE
ajax_ajaxjson {
typeNum = 1
config {
disableAllHeaderCode = 1
additionalHeaders = {
10 {
header = Content-Type: application/json
replace = 1
}
}
xhtml_cleaning = 0
debug = 0
no_cache = 1
admPanel = 0
}
10 < tt_content.list.20.tx_energieportal_ajaxjson
}
(in EXT:\Configuration\TypoScript\setup.txt)
Now when trying to load that page type, I get the following error:
TYPO3\CMS\Core\Error\Http\ServiceUnavailableException
The page is not configured! [type=1][]. This means that there is no TypoScript object of type PAGE with typeNum=1 configured.
I also added a test variable, and when rendering that variable with
<f:cObject typoscriptObjectPath="testvar"/>
I get the error:
No Content Object definition found at TypoScript object path "testvar"
I setup my sys_template.php up like this:
<?php
defined('TYPO3_MODE') or die();
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'energieportal',
'Configuration/TypoScript',
'Energieportal Frontend'
);
(in EXT:\Configuration\TCA\sys_template.php).
I also tried renaming the setup.txt to setup.typoscript.
Is there anything else I need to do to have my module load the setup.typoscript? I looked at the docs and other modules, but I couldn't find anything for setting up that file.
I used the search function, but the only similar question wasn't really answered. (Link)
If you want to override the TCA of existing tables, you need to put the file into Configuration/TCA/Overrides/.
So, the correct path for your sys_template.php needs to be Configuration/TCA/Overrides/sys_template.php.
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile only adds it to the list of static TypoScript files which can be loaded in a TypoScript template. It does not load the TypoScript file automatically.
You will have to include it in a TypoScript template in the TYPO3 backend. You can find the available static templates in the Includes tab under Include static (from extensions).
Alternatively you can include it in a different TypoScript file that is already loaded in the previously mentioned way using #import 'EXT:EXT:energieportal/Configuration/TypoScript/setup.typoscript' or <INCLUDE_TYPOSCRIPT: source="FILE:EXT:energieportal/Configuration/TypoScript/setup.typoscript">
It is also possible to add TypoScript directly from PHP using \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('My TypoScript'), so you can add the #import or <INCLUDE_TYPOSCRIPT...> line there. You can add this in your extension's ext_localconf.php or Configuration\TCA\Overrides\sys_template.php. It is however usually not recommended as you might not want the TypoScript loaded for all pages and/or sites in a TYPO3 installation.

How do I override the rendering of a Content Element in fluid_styled_content?

In TYPO3 8.7 I am trying to override the file Textpic.html from fluid_styled_content so that I can use my own rendering for the textpic content element.
As long as I modify the original file inside the extension itself, this is working fine.
However, I want to create my own copy of this file and use that copy. This is not working - TYPO3 does not use my own version of the file.
Here is what I did:
In the Setup field of my TypoScript template I added:
lib.contentElement.templateRootPaths.100 = /fileadmin/template/Templates/
Then I copied Textpic.html from fluid_styled_content/Resources/Private/Templates into my folder /fileadmin/template/Templates so that it becomes /fileadmin/template/Templates/Textpic.html.
Any hints, what I might be missing?
You can do this by setting constants. For example
styles.templates {
templateRootPath = EXT:siteconfig/Resources/Private/Extensions/fluid_styled_content/Templates/
partialRootPath = EXT:siteconfig/Resources/Private/Extensions/fluid_styled_content/Partials/
layoutRootPath = EXT:siteconfig/Resources/Private/Extensions/fluid_styled_content/Layouts/
}
So these locations will be checked first, if no file is there for a certain contentelement, the version of fluid_styled_content will be used.
Check the original at /typo3/sysext/fluid_styled_content/Configuration/TypoScript/constants.txt
Make sure you keep the same subfolder structure for partials.
The problem was the line
lib.contentElement.templateRootPaths.100 = /fileadmin/template/Templates/
This line is wrong. There has to be no slash at the beginning of the path.
The right line reads:
lib.contentElement.templateRootPaths.100 = fileadmin/template/Templates/
I found that in the code example of the Templating Tutorial at https://docs.typo3.org/typo3cms/TemplatingTutorial/BasicFluidTemplates/Index.html.

Extend News Administration Backend Module

I would like to have a custom view of the news listing in the backend module.
My own extension has custom layouts and partials but TYPO3 doesn't use them.
setup.txt
module.tx_news {
view {
templateRootPaths.0 = EXT:news_review/Resources/Private/Templates/
partialRootPaths.0 = EXT:news_review/Resources/Private/Partials/
layoutRootPaths.0 = EXT:news_review/Resources/Private/Layouts/
}
Here's my file structure:
file structure
Versions used:
TYPO3 7.6.15
news 5.3.2
Following has been consulted but didn't work for me:
https://stackoverflow.com/a/33775089/7566899 and
https://forge.typo3.org/issues/66306
edit: Fixed the paths (without /Administration/)
templateRootPaths.0 = EXT:news_review/Resources/Private/Templates/Administration/
The news template file paths are appended to this path.
So if news includes Administration/Index.html, the full path would be
EXT:news_review/Resources/Private/Templates/Administration/Administration/Index.html
(double Administration/)
I don't think you wanted that.

TYPO3 Powermail 2 - how change template for plugin instance

I have Powermail( new version, the one based on Extbase) instance at the bottom of each page. This instance is placed somewhere on the website and rendered in footer via RECORDS.
Now, I need this instance to have different templates than the rest of Powermail plugin instances.
So, how can I pass this configuration to the plugin instance? There is no option in flexform to specify the path to the template so I'm stuck.
Thanks in front ;)
You can use an extension template on the respective page, and set the templateRootPath accordingly - either by setting the constants plugin.tx_powermail_view.templateRootPath or by setting the setup settings plugin.tx_powermail.view.templateRootPath directly:
plugin.tx_powermail {
view {
templateRootPath = {$plugin.tx_powermail.view.templateRootPath}
partialRootPath = {$plugin.tx_powermail.view.partialRootPath}
layoutRootPath = {$plugin.tx_powermail.view.layoutRootPath}
}
}
(partials and layout follow the same pattern)
See: http://typo3.org/extension-manuals/powermail/2.0.0/view/1/48/
You can set a different layout for this in the "Extended" Tab of the form, as described here:
http://docs.typo3.org/typo3cms/extensions/powermail/Powermail/Faq/Index.html#how-to-change-the-style-selector-with-my-own-values-in-forms-pages
This way a class will be set in the < form >-tag, und you may style the record differently.