I have enabled config.spamProtectEmailAddresses = -4 for my Typo3-site.
In a fluid template (that is used for generating the HTML of an email generated by the extension powermail), how can I override this setting to not protect the email adress here?
I have tried (see parseFunc)
<f:format.html parseFuncTSPath="lib.parseFunc_email">{text}</f:format.html>
but I can't find out which TS-property needs to change.
Or is there a different way to achieve this?
The most simple way would be to generate the e-mail link yourself:
{linkText}
I changed the TS setting config.spamProtectEmailAddresses = -4 for specific pages:
config.spamProtectEmailAddresses = -4
[globalVar = _GET|tx_powermail_pi1|action = create]
config.spamProtectEmailAddresses = 0
[global]
(From https://forge.typo3.org/issues/72983)
Related
In Typo3 I have a content element with a plain text field (no RTE / CKEditor field). In case a user enters an e-mail address, it should be automatically converted into an e-mail link. How can I achieve this with Typoscript or even directly in Fluid-Script?
This is my approach: per <f:cObject ... /> pass the text to a typoscript, which searches for an #-character, selects the whole word and then adds the corresponding A-tags:
<f:cObject typoscriptObjectPath="lib.emaillink" data={adrtxt: tx_mask_cnt_consultation_adr_item_txt} />
lib.emaillink = COA
lib.emaillink {
5 = LOAD_REGISTER
5 {
dAdrTxt.data = field:adrtxt
}
10 = TEXT
10 {
data = register:dAdrTxt
# Search for '#', select whole word, add A-tags ... ?
}
}
Thank you in advance for any help!
That was a feature of TYPO3, but it changed in details from version to version.
Sometimes you need a prefix mailto: sometimes you must avoid that prefix.
Especially if you want to hide the emailaddress from email-harvesters, an email was encrypted linked with javascript and the visible (original) email address was modified to fool regexp searching.
have a look at the manual
config {
spamProtectEmailAddresses = -5
spamProtectEmailAddresses_atSubst = <span class="at">(at)</span>
}
(with the option to replace all span-tags with class at by a simple # on runtime, so the email looks normal to a visitor.
As I always use this encryption, I can't say whether it only works with this feature active. Give it a try.
In TYPO3 9 I managed to display the current username in a FLUID-template with the following Typoscript:
[loginUser=*]
temp.username = TEXT
temp.username {
insertData = 1
value = {TSFE:fe_user|user|username}
noTrimWrap = | ||
}
[global]
In TYPO3 10.4 this is not working anymore. Any idea how to display the current user?
Many thanks! Urs
In Typo3 V10, you have to use the Context API to retrieve data from global objects, try this :
[frontend.user.isLoggedIn]
temp.username = TEXT
temp.username.data = TSFE:fe_user|user|name
temp.username.wrap = |
[global]
Have a look at those links :
https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/DataTypes/Index.html
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Context/Index.html#context-api
Florian
It's probably not working because you're using the old TypoScript conditions. Since TYPO3 9 the conditions work with Symfony expressions. The old conditions were deprecated in TYPO3 9 (but still worked) and removed in TYPO3 10. So [loginUser=*] will never be true in TYPO3 10. You should use [frontend.user.isLoggedIn] instead.
See https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Conditions/Index.html for more about the new TypoScript conditions.
Why use TypoScript? It is very limited on what it can bring back. I just finished a tutorial where you can use a ViewHelper to add an ExtBase variable which assigns the whole user object in the FrontEnd and you can use it wherever you want with all it's relations, even the image, which is difficult to get via TypoScript.
TYPO3 tutorial
Best regards
there is no problem to prefill normal fields, but i am not able to prefill one or more checkboxes neither with typoscript nor via GET-Parameter.
i tried:
GET-Parameter:
&tx_powermail_pi1[field][marker][0]=1
&tx_powermail_pi1[field][marker][0]=1
Typoscript:
marker = TEXT
marker.value = 1
marker.0 = TEXT
marker.0.value = 1
is there a passibility to prefill /preselect a checkbox?
Thanks!
OK, i got it after analysing the PrefillMultiFieldViewHelper ... :-)
I changed the definition of the labels of my checkboxes in the flexbox:
Option|1
Other Option|2
Now i can prefill my checkboxes with:
&tx_powermail_pi1[field][marker][]=1&tx_powermail_pi1[field][marker][]=2
Easy when you got the logic behind it :-)
Sorry for the noise!
I use an own extension which generates the html header and this works fine. Only the default header is still generated, so when we look at the page code there are two htlm headers generated. Even if I use the setting below. Any ideas?
page = PAGE
page.config {
noPageTitle = 1
}
On the rewritten question: how to remove the page title tag.
config.noPageTitle = 2
This is an age-old extravaganza of TypoScript:
https://forge.typo3.org/issues/14929
On the original wording of the question: how to remove page header:
There are two ways, either use
page {
config.disableAllHeaderCode = 1
}
or get a copy of typo3/sysext/cms/tslib/templates/tslib_page_frontend.html, edit it and enable it via
config.pageRendererTemplateFile = /your/path (without page.!)
I have stopped doing that (disabling the header) though, as you will miss out on some useful JS TYPO3 creates (email address encryption, FE Login with RSA).
I couldn't find anything about this on the web or in the documentation, so I wonder if it's possible.
lib.stdheader.10.setCurrent.htmlSpecialChars = 0
Works fine for standard header and I already tried
lib.stdheader.20.setCurrent.htmlSpecialChars = 0
for subheader, but doesn't work.
Any hint is very appreciated!
Take a look at TypoScript Object Browser in Template module.
You'll see, that lib.stdheader.20 doesn't have setCurrent property. Instead it has bunch of properties, like 1., 2., ... and default. All of them correspond to header type: h1, h2, h3 etc. and default (which is h2).
So, you need to override htmlSpecialChars for each of them. Or, at least, for default, if you're not planning to use different subheader types:
lib.stdheader.20.1.htmlSpecialChars = 0
lib.stdheader.20.2.htmlSpecialChars = 0
...
lib.stdheader.20.default.htmlSpecialChars = 0
Try this one :-
For headers :
lib.stdheader.10.setCurrent.htmlSpecialChars >
For subHeaders :
lib.stdheader.20.setCurrent.htmlSpecialChars >