TYPO3 Powermail - Methods to add a link in a checkbox label or title
Asked Answered
S

5

5

Since powermail 6.0. it's possible to add a link in a checkbox label (for GDPR) as per the docu:

https://docs.typo3.org/typo3cms/extensions/powermail/ForAdministrators/Privacy/Index.html#add-a-link-in-a-checkbox-label.

It says:

Just use an option in your FlexForm like (with an example link to page 123 where the privacy terms are located):

I accept the <f:link.page pageUid="123">privacy terms</f:link.page> | privacy terms accepted

After that you have to enable html in labels (this feature is turned off for security reasons). Example TypoScript constants:

plugin.tx_powermail.settings.misc.htmlForLabels = 1

... yet it also says that '(this feature is turned off for security reasons)'.

What other options are there to accomplish this? (with no security loss?)

Stouffer answered 15/5, 2018 at 15:55 Comment(0)
B
4

We add a normal content element with the link above the checkbox. For example to accept the terms and conditions. Then the content element is included in the form. See https://docs.typo3.org/typo3cms/extensions/powermail/ForEditors/AddANewForm/FieldContentElement/Index.html

Burnejones answered 15/5, 2018 at 18:10 Comment(2)
... where do I create, store and save this content element? In powermail I created a new field -> then chose Type 'Content Element' ... but what do I select?Stouffer
From docu: General: If you want to show a content element within your form (text, text with image, etc...), use this field. An element browser allows you to select a tt_content record. This text is not submitted. You can create content element with list modul somewhere you want or create a page and place the content element there to select later in powermail.Burnejones
S
3

You can enable it in:

Template - > Constant Editor - > Powermail_Aditional - > Allow html in html fields/ Allow html in field labels

Then you can use HTML-Code. Or better:

<f:link.page pageUid="123">Privacy Policy</f:link.page>
Stale answered 21/11, 2018 at 14:7 Comment(0)
C
1

1) The solution with the content element is a good thing - that should also be described

2) It's wrong that powermail version 6.0 is needed to disable the IP-storing. This feature is available for years now but 6.0 turns it off by default

3) If you trust your editors or if you already allow your editors to add content elements of type HTML it's really also no problem to allow HTML in powermail field labels for your editors

Maybe I should update the privacy documenation to clearify this points

Crossgrained answered 16/5, 2018 at 7:35 Comment(2)
Thanks for the additional hints Alex!Stouffer
I dont get it. Setting plugin.tx_powermail.settings.misc.htmlForLabels does absolutely nothing in my installation.Gokey
B
1

This solution appears again and again at the top of Google. But the name is edit!

here for the new Powermail Version:

plugin {
    tx_powermail {
        settings {
            misc {
                htmlForHtmlFields = 1
                htmlForLabels = 1
            }
        }
    }
}
Banwell answered 26/2, 2021 at 16:47 Comment(0)
S
0

You can set link in checkbox lable or title like,

I accept the <a href="index.php?id=123">privacy terms</a>

in powermail/Resources/Private/Partials/Form/Field/Check.html

Change code

   <vh:string.RawAndRemoveXss>{setting.label}</vh:string.RawAndRemoveXss>

to

   <f:format.raw>{setting.label}</f:format.raw>
Stimulant answered 21/6, 2018 at 7:51 Comment(1)
Just doing this will cause an XSS Auditor Error in Chrome since the label is used as checkbox value, too. But you can provide an additional value for the checkbox by using a pipe in the label: I accept the <a href="index.php?id=123">privacy terms</a> | Privacy acceptedMentholated

© 2022 - 2024 — McMap. All rights reserved.