TYPO3 Powermail 2 - how change template for plugin instance - typo3

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.

Related

TYPO3 (10.4) Felogin: Can´t change Template

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

No default link classes in typo3 8 anymore?

In V7 all internal/external/download links got an additional class by default, like 'internal-link' or 'download'.
Looks like in V8 with the new CKEditor this feature is gone.
Is there a way to reimplement it via typoScript or some kind of yaml RTE config?
An automatic solution, not the solution where the user have to pick a custom style, thats our current workaround.
If these classes should be applied automatically to specific link types without enabling the editors to change those classes, you should go for TypoScript parseFunc:
https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Parsefunc.html?highlight=parsefunc
Especially makeLinks, tags and typolink should be useful here:
https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Makelinks.html#makelinks
https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Tags.html#tags
https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Typolink.html#atagparams
For example you would assign a specific class to an external http link automatically created by makelink like this:
parseFunc {
makelinks = 1
makelinks {
http {
keep = path
extTarget = _blank
ATagParams = class="external-link"
}
}
}

How to get the Log In Form on every page? (for example in footer) Typo3

Is there a way to get the Log In Form for Frontend User on every page? I would prefer the footer.
And if someone is logged in you can see the Log Out Button.
Is this possible without an extension?
You can copy the default felogin output to wherever you want on your template. For example use lib.login, copy the plugin.tx_felogin_pi1 into it, change the template and you're fine.
lib.login < plugin.tx_felogin_pi1
lib.login.templateFile = path/to/your/template/file
More you can see in the official documentation: https://docs.typo3.org/typo3cms/extensions/felogin/8.7/Configuration/Index.html
In general there are three options to include a CE (e.g. the Login-form) on all pages:
use typoscript to generate the CE. Normally the CEs are defined in tt_content, from where you could copy the base configuration and adapt it. For some plugins you also find a complete configuration beyond lib (for newer extensions there you only find the settings). All the configuration must be done in typoscript.
use typoscript to render the content of a special page/ column. In this variant you have a special page only for content referenced somewhere else. Advantage: you could configure the CE in the usual way. Try to avoid referencing CEs by uid as an editor might disable or delete the current element(s) and insert a new one which would not be rendered.
use a special column in your root page and inherit the content to all subpages. Advantage: you could change the inherited content easily on each page (if this column is available in the current backend layout).
example for 3:
variables {
footer_content < styles.content.get
footer_content.select.where = colPos = 15
footer_content.slide = -1
}

How to rename subheader in TYPO3 CMS backend

How can I rename a TYPO3 CMS backend field for authors? i.e. the mentioned field for content-elements of csc_styled_content?
In general, overriding label names can by done with Page TSconfig in the backend. The following example modifies the label of the subheader field.
TCEFORM {
tt_content {
subheader.label = My new Label-Name
}
}
There are two way to configure that adjustment in TYPO3.
Type your configuration changes directly to the page settings » resources » TypoScript Configuration » Page TSConfig (see the screenshot below)
as an alternative you can store that configuration directly in the file system - either in your custom extension (e.g. at typo3conf/ext/my_extension/Configuration/TSconfig/labels.t3s) or with a similar name in the global file storage (e.g. fileadmin/templates/configuration/...)
That's basically it to provide custom labels for any database table in the TYPO3 backend. Find more aspects that can be adjusted in the accordant Page TSconfig documentation.
If you want to rename a field of an extension like tx_news you could do it this way.
TCEFORM {
tx_news_domain_model_news {
title.label = Your New Label
}
}
Now there are two ways to get this to work:
Put it in Page TSConfig of the page settings
OR
Load it with your extension from a file (e.g. EXT:my_extension/Configuration/pageTSConfig.typoscript). For that you have to import this script by EXT:my_extension/ext_localconf.php!
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:my_extrension/Configuration/pageTSConfig.typoscript">');

Extbase storagePid with levelfield

I try to set the the storagePid of an extbase plugin by using levelfield like this:
plugin.tx_myext.persistence.storagePid = TEXT
plugin.tx_myext.persistence.storagePid.data= levelfield: -1, storage_pid, slide
Using the storage_pid of the current page is no problem:
plugin.tx_myext.persistence.storagePid = TEXT
plugin.tx_myext.persistence.storagePid.data= page:storage_pid
But I want to use levelfield to improve the usability of an extension. Thus you only would have to setup the storage_pid in the root page and include the default typoscript setup for the extension, which uses levelfield, into the root template...
Does anybody have a clue why levelfield is here not working?
Not all fields can be used by default with levelfield. The fields that can be used on scratch are defined in $TYPO3_CONF_VARS["FE"]["addRootLineFields"]
To add another field simply add
$GLOBALS["TYPO3_CONF_VARS"]["FE"]["addRootLineFields"] .= ",storage_pid";
in typo3conf/ext_tables.php or in the ext_tables.php of your extension.