I want a new required field in TYPO3.
In the content element "image/text" the images can include an altText.
It should be possible, that this field is a required field.
I put this into my exttables.php
$TCA['tt_content']['columns']['altText']['config']['eval'] = 'required';
It doesn't work for me.
Any ideas?
Because the new File Abstraction Layer (FAL) the image references won't be saved in the tt_content table.
The answer is:
$TCA['sys_file_reference']['columns']['alternative']['config']['eval'] = 'required';
Related
I try to read a flexform data out in typoscript. I tried it with several approaches, but none of them works correctly:
ajax.30 = TEXT
ajax.30.value = {$plugin.parser.settings.maxNumber}
ajax.40 < {$plugin.parser.settings.maxNumber}
ajax.50 < {$plugin.parser.settings.maxNumber}
ajax.60 = TEXT
ajax.60.data = {$field:flexform_varNum}
ajax.70 = TEXT
ajax.70.data = flexform : pi_flexform:settings.varNum
Can anyone give me a hint for the right syntax?
I'm using Typo3 9.5.13.
It is not possible to read out FlexForm data without an actual content element.
The CONTENT or COA objects would provide that. See for example Get FlexForm configuration in TypoScript
The feature was added in TYPO3 8.4 https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/8.4/Feature-17309-AccessFlexformValueViaTS.html
Using Typo3 8.7.4/Powermail 3.21.2
I'm pretty new to Typo3, so I have no clue if this is even the right way to do it, but heres my problem:
On the site there are several subpages with images/descriptions of articles on them. Every article has an UID stored in the image title (dont ask me why).
When an image is clicked it links to another page with a powermail mailform.
In this form there's a textfield for the UID which should automatically fill with the UID in the image title so the user doesn't have to do it manually. That essentially it.
I know you can prefill a field with a value or placeholder, but should I even use a textfield or use TS instead?
And what should I add to the image link for the UID to get posted to the form?
Or am I doing this completely wrong?
All help appreciated, thank you and have a nice day!
You can Do like This.
plugin.tx_powermail.settings.setup.prefill {
position = CONTENT // Here Position is your powermail form fields
position {
table = Your tables
select {
selectFields = title
andWhere.data = GP:title // Pass your url parameters
andWhere.wrap = uid=|
pidInList = 108 // Added Your Pid
}
renderObj = TEXT
renderObj.field = title
}
}
There are several ways of prefilling form fields in powermail (look at the manual https://docs.typo3.org/typo3cms/extensions/powermail/ForAdministrators/BestPractice/PrefillField/Index.html) and I would say that there is no wrong way. Just choose the right one for your needs.
I am using powermail to allow a FE-User to edit a couple of fields of his own User-Record. Works fine, no hassle.
Now I would also like to allow the upload of a file. Is there a way to save the file to FAL with powermail? Unfortunately I have found no resources on this whatsoever. Maybe it is possible to implement a userfunc when saving to DB that would generate the required DB entries? When using powermails "upload"-field-type the file gets written to uploads/tx_powermail. I have access to that files path in my db_entry step in typoscript and could pass it on to a userfunc - which in return should
generate the sys_file entry
delete a possiblibly already existing sys_file_reference
generate the new sys_file_reference
Am I missing something?
Any ideas on this? Has anyone done something like this before?
Or is my only alternative to switch from powermail to a custom extbase extension?
System: TYPO3 7.6.16, Powermail 3.17
Thanks
I have same problems in powermail and i use powermail Finisher class like below.
TYPOSCRIPT:
plugin.tx_powermail.settings.setup {
finishers {
1 {
class = Vendor\Ext\Finisher\AddImageFinisher
config {
# set pid.
pid = TEXT
pid.value = 79 // Here
#set powermail fields title
field_name = Name
field_place = Place
field_email = E-Mail
field_message = Message
}
}
}
}
Please reffere this link. AddImageFinisher Class file
At the moment powermail don't uses FAL relations. If you need something like this, you have to add an own finisher that does the upload stuff - see https://docs.typo3.org/typo3cms/extensions/powermail/ForDevelopers/AddFinisherClasses/Index.html
Just for the record. TYPO3 8 core ships a new form extension which allows both. With the save to database finisher you can easily edit fe_user data. Furthermore, all image uploads are handled as FAL. We will document this use case and release a small extension which does the job (soon).
In TYPO3 (7.2.0) using the standard template engine, is there a way to add a placeholder attribute to the standard mail form text input?
At the moment I am using JavaScript to convert the labels into placeholders, but I am open to suggestions on a better way to do this...
The suggested solution of #biesior does only work for EXT:form 7.4 and higher (see changelog). The supplied picture shows the form wizard of TYPO3 7.5 or 7.6. In 7.2 you won't find any placeholder attribute in the wizard.
I recommend updating to TYPO3 7.6 since this version includes a major rewrite of EXT:form. You will be able to use fluid templates to customize your forms. Furthermore HTML5 attributes are possible. Before the rewrite the set of allowed attributes was quite limited. Now you are able to add all attributes you can think of (for example "data-"). See changelog.
If you have any questions regarding EXT:form join the channel on Slack. If you don't know Slack yet, check out the invite function.
During form fields editing you have many properties, also Placeholder
in text version it will be:
10 = TEXTLINE
10 {
type = text
class = foo-class
id = foo-id
name = foo
placeholder = Hmmm?
required = required
label {
value = My Field
}
}
I use the Content Element in my Typoscript. The take a Image from a Folder. I mad this 1000 times in older TYPO3 Versions.
This is mi Code
lib.test = CONTENT
lib.test{
table = tt_content
select{
uidInList=4
pidInList=2
}
}
The Folder ID's are correct.
I mapped the test with Templavoila in a div(inner)
We've had the same issue and ported back to Typo3 4.7.x. TemplaVoila and also a lot other extensions still have problems working correctly in 6.x
Try below one;
lib.logo = RECORDS
lib.logo{
tables = tt_content
source = 123 #Respected Content Element ID
}