powermail should update a `pages`-field - typo3

I want to use powermail (7.4.0) to give special page visitors the option to modify a field in the current pages record.
my setting so far:
plugin.tx_powermail.settings.setup {
dbEntry {
1 {
_enable = TEXT
_enable.value = 1
_table = TEXT
_table.value = pages
uid = TEXT
uid.data = TSFE:id
description = TEXT
description.field = abnahmestatus
}
}
prefill {
abnahmestatus = TEXT
abnahmestatus.data = TSFE:description
}
}
How can I get powermail to update the record (instead of inserting)?
How can I prefill the input field with the current value from the pages field?

Answer 1: update instead of insert:
I missed the line
_ifUnique.uid = update
from the manual example.
Answer 2:
I inserted {abnahemstatus} which was not helpfull as it overwrote the typoscript prefill. so:
no value in prefill_value of the field definition
the correct definition is abnahmestatus.data = page:description (TSFE is obsolete)

Related

get all checked checkbox values from a powermail field in typoscript

I’m looking for a way to get all checked checkbox-values from a field in a powermail form. I can access single values from the array in my typoscript template with
data = GP:tx_powermail_pi1|field|marker|index.
Is there a way to interate over the array when I don't know the number of checkboxes (dynamically filled) or to serialize the array? I am not experienced with typoscript or powermail but allready tried to find a solution for quite some time.
What i am trying to achieve ist to have a multiselect field for people to send the mail to that gets populated from fe_users.
The relevant code from the typoscript template that overwrites the receiver is:
plugin.tx_powermail {
settings {
setup {
receiver {
enable = {$plugin.tx_powermail.settings.receiver.enable}
overwrite {
email = COA
email {
10 = CONTENT
10 {
table = fe_users
select {
pidInList = 8689
where {
# UID of the fe_users record is given in field with marker {fragegehtan}
data = GP:tx_powermail_pi1|field|fragegehtan|0
wrap = uid=|
intval = 1
}
}
renderObj = COA
renderObj {
10 = TEXT
10.field = email
stdWrap.wrap = |,
}
}
}
}
}
}
}
}
This is supposed to create a comma separated list of uids of all selected fe_users. Ist there any advice how to do it?

TYPO3 Constants

Hi in my Constants I have declared a constant
PATH_TO = user_vorlagen
All ok this is the result:
in Setup:
file = Resources/Private/Partials/{$PATH_TO}/landingpage
/LANDINGPAGE_Footer.html
This works the path is correctly rendered:
file = Resources/Private/Partials/user_vorlagen/landingpage/LANDINGPAGE_Footer.html
Now my question: i want change this and use a fe_users field {TSFE:fe_user|user|lockToDomain}.
This gives me the correct result in debug "user_vorlagen", but if I inserted in path
file = Resources/Private/Partials/{TSFE:fe_user|user|lockToDomain}/landingpage...
It doesn't work.
I try file.inserData=1
someone can give me a hint?
The .insertData = 1 functionality is only available in TypoScript objects with stdWrap support and I don't think that the file is supporting that.
Either try:
file = TEXT
file.value = Resources/Private/Partials/{TSFE:fe_user|user|lockToDomain}/landingpage
file.insertData = 1
Or use PHP to insert that variable.
It must work in this context.
lib.MAIL_WRAP = FLUIDTEMPLATE
lib.MAIL_WRAP {
#stdWrap.editPanel = 1
#stdWrap.editPanel.allow = move, edit, hide, new
file = Resources/Private/Partials/{$USER_PATH_MAILINGS}/mail/MAIL_wrap.html
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10.references {
table = tt_content
uid.field = uid
fieldName = assets
}
}
}

Solr Indexing - Manipulating the search result

I am working with the TYPO3 Solr extension and I have some doubts regarding the solr result set manipulation.
I have added a special configuration for indexing some particular pages in my page tree. ie Pages that starts with the label "Expertise%" .I have managed to added this successfully . And the indexing is working successfully with our any trouble. But what I would like to achieve is that , I want to added parent page title to the search result.i.e
This is the page tree
|---- 1.00.100 (parent page)
|--Subpage 1
|--Subpage 2
|--Expertise
|--Test page`
And in the solr search result should be
1.00.100 - Expertise
Is this possible in TYPO3 Solr. Is there any hook or signalslot available to implement this?
Tried this ,But doesn't seems to work for me ?
plugin.tx_solr.index.queue.expertise_offered = 1
plugin.tx_solr.index.queue.expertise_offered {
table = pages
additionalWhereClause = doktype = 1 AND no_search = 0 AND title LIKE '%Expertise offered%'
fields {
title = title
content = CONTENT
parentPageTitle_stringS = CONTENT
parentPageTitle_stringS {
table = pages
select {
selectFields = title
where = uid = ###pid###
}
markers {
pid.data = field:pid
}
}
content {
table = tt_content
select {
selectFields = header, bodytext
}
renderObj = COA
renderObj {
10 = TEXT
10.field = header
# This removes HTML tags
11 = SOLR_CONTENT
11.field = bodytext
}
}
url = TEXT
url.typolink.parameter = TEXT
url.typolink.parameter.field = uid
}
}
You probably don't need any hook or signal-slot. You can do it as follows:
Add the title of the parent page to your indexing configuration. There is no field for it, but you can dynamically add fields to SOLR documents. This is done by sending the data in a field which has a certain suffix, which determines the field type.
For example: Setting the field parentPageTitle_stringS to the parent pages title in the indexing configuration creates a new stored, single-valued field of type string in the indexed document.
Filling this field could look like this:
plugin.tx_solr {
index {
queue {
<yourindexconfigname> = 1
<yourindexconfigname> {
table = pages
fields {
parentPageTitle_stringS = CONTENT
parentPageTitle_stringS {
# Build a query here to retrieve
# the parent page title.
}
}
}
}
}
}
In your template for search results, you can use the marker ###RESULT_DOCUMENT.parentPageTitle_stringS### to retrieve the field.
The available field types can be found in EXT:solr/Resources/Solr/typo3cores/conf/general_schema_fields.conf from line 157 onwards (refering to version 3.0.0 here).
You should of course use a type other than string if you want to have the result indexed nicely.

How can I create a link to a specific, known page using TypoScript?

I am working on some Typo3 6.2 templates. I want to insert a link into the template using Typoscript.
I have a constant {$HOME_SHORTCUT}, which has the title "Startseite" & the path /start. I want the link to look like this:
Startseite
I am using this to insert the link before a set of breadcrumbs. The link path is correct but the value/text of the link is the pageID of {$HOME_SHORTCUT}, not the header text, which is what I want:
stdWrap.prepend = TEXT
stdWrap.prepend {
value = {$HOME_SHORTCUT} ###HOW DO I USE THE TITLE OF THE PAGE AS THE VALUE?####
stdWrap.typolink {
field = header
parameter = {$HOME_SHORTCUT}
}
}
This outputs:
146
Which is incorrect. That's the page ID, not the header. How do I get the header of {$HOME_SHORTCUT}?
When you leave out the "value" the page title is set automatically:
stdWrap.prepend = TEXT
stdWrap.prepend.typolink.parameter = {$HOME_SHORTCUT}
Following along with this answer, I constructed this, which gives the desired mark-up:
stdWrap.prepend = TEXT
stdWrap.prepend {
value {
table = pages
select {
where = uid = {$HOME_SHORTCUT}
}
renderObj {
10 = TEXT
10 {
field = title
wrap = |
}
}
}
stdWrap.typolink {
field = header
parameter = {$HOME_SHORTCUT}
}
}
Which seems like a really, really long-winded way of saying "Wrap this page title with a link to this page"- I am definitely interested in hearing of better methods.

Typoscript If/Else?

I have two forms in powermail 1.6 and want to change the form action according to the form uid.
I have the following code:
plugin.tx_powermail_pi1 {
formaction >
formaction = TEXT
formaction {
typolink {
parameter = 280
parameter.if {
equals.field = uid
value = 1618
}
...
}
}
}
The code is working - if the id of the form is 1618, then the form action leads to the page with the id 280.
But how can I make an Else statement to change the form action for another form id e.g. 1612 to page id 290?
You have to do it in a COA
formaction = COA
formaction.10 = TEXT
formaction.20 = TEXT
The .10 will handle the true condition.
The .20 will handle the else condition