Im using Typo3 and got 2 Powermail Forms on a Hotel Page.
One small form on every Page where you can put the checkin and checkout date.
After this you will be redirected to the main form.
How can i prefill the daterecords from the small after the redirect in the mainform?
Both forms have the same variable names {checkin} and {checkout}
Thanks
Try it..
plugin.tx_powermail.settings.setup.prefill {
# Fill field with marker {current_date}
current_date = TEXT
current_date{
data = date : U
strftime = %d-%m-%Y %H:%M:%S
}
form2date = TEXT
form2date{
data = date : U
strftime = %d-%m-%Y %H:%M:%S
}
seminar = CONTENT
seminar {
table = tx_news_domain_model_news
select.pidInList = 118
select.where.stdWrap.cObject = TEXT
select.where.stdWrap.cObject.data = GP:tx_news_pi1|news
select.where.stdWrap.cObject.wrap = uid = |
select.where.stdWrap.cObject.insertData =1
renderObj = COA
renderObj {
10 = TEXT
10.dataWrap ={field:title}
}
}
price = CONTENT
price {
table = tx_news_domain_model_news
select.pidInList = 118
select.where.stdWrap.cObject = TEXT
select.where.stdWrap.cObject.data = GP:tx_news_pi1|news
select.where.stdWrap.cObject.wrap = uid = |
select.where.stdWrap.cObject.insertData =1
renderObj = COA
renderObj {
10 = TEXT
10.dataWrap ={field:price}
}
}
location = CONTENT
location {
table = tx_news_domain_model_news
select.pidInList = 118
select.where.stdWrap.cObject = TEXT
select.where.stdWrap.cObject.data = GP:tx_news_pi1|news
select.where.stdWrap.cObject.wrap = uid = |
select.where.stdWrap.cObject.insertData =1
renderObj = COA
renderObj {
10 = TEXT
10.dataWrap ={field:tx_roqnewsevent_location}
}
}
event_startdate = CONTENT
event_startdate {
table = tx_news_domain_model_news
select.pidInList = 118
select.where.stdWrap.cObject = TEXT
select.where.stdWrap.cObject.data = GP:tx_news_pi1|news
select.where.stdWrap.cObject.wrap = uid = |
select.where.stdWrap.cObject.insertData =1
renderObj = COA
renderObj {
10 = TEXT
10.value.field = tx_roqnewsevent_startdate
10.value.date = d-m-Y
#10.strftime = %d-%m-%Y
}
}
}
Hi try add (width js on submit action) in form action url or redirect url width parametrs [checkin]="" and [checkout]="". Like this
<form class="form-horizontal powermail_form powermail_form_1" action="index.php?id=5&checkin=25.05.15&checkout=25.06.15" method="post">
...
for test try use url "yousite.com/index.php?id=5?checkin=25.05.15&checkout=25.06.15" fields in form must be fill.
Where "5" - your main form page id
Related
I'm trying to show informations of a single Fe user with typoscript. Everything is working fine except I can't get the image path. How can I get the path to the associated image?
Thanks for pointing me in the right direction.
Noël
EDIT:
Hi, I'm using TYPO3 version 9.5.21.
The TS code to get the fe user data:
lib.feUserLink = CONTENT
lib.feUserLink {
table = fe_users
select {
pidInList = 16
max = 10
orderBy = last_name DESC
}
renderObj = COA
renderObj {
10 = TEXT
10.field = username
10.typolink {
parameter = 483
additionalParams.dataWrap = &user={field:uid}
useCacheHash = 1
}
10.wrap = |</br>
20.### here I'd like to get the image path###
}
}
In TypoScript you can use the objects FILES and IMAGE in order to get an image, you can try something like this I guess :
lib.feUserLink = CONTENT
lib.feUserLink {
table = fe_users
select {
pidInList = 16
max = 10
orderBy = last_name DESC
}
renderObj = COA
renderObj {
10 = TEXT
10.field = username
10.typolink {
parameter = 483
additionalParams.dataWrap = &user={field:uid}
useCacheHash = 1
}
10.wrap = |</br>
20 = FILES
20 {
references {
table = fe_users
uid.data = {field:uid}
fieldName = image
}
renderObj = IMAGE
renderObj {
file.import.data = file:current:originalUid
}
}
}
}
Back in TYPO3 4.5 there was TSFE:lastImgResourceInfo|filesize to access the filesize of the last rendered image in TypoScript. Is there an equivalent in TYPO3 7.6.x or 8.7.x?
I would need it here:
70 = CONTENT
70 {
table = tt_content
select {
orderBy = sorting
where = colPos=0
pidInList.data = field : content_from_pid
max = 1
}
wrap = <enclosure type="image/jpeg" url="{$rssFeed.feedBaseUrl}|" />
renderObj = COA
renderObj {
10 = FILES
10 {
references {
table = tt_content
uid.data = uid
fieldName = image
}
renderObj = COA
renderObj {
10 = IMG_RESOURCE
10 {
file {
import.data = file:current:originalUid
width.field = imagewidth
maxW = {$rssFeed.feedImageMaxWidth}
}
}
20 = TEXT
# this used to work in TYPO3 4.5
20.data = TSFE:lastImgResourceInfo|filesize
20.wrap = " length="|
}
}
}
}
Should be TSFE:lastImageInfo, even in TYPO3 4.5. Seems to be set in later versions, too.
TSFE:lastImgResourceInfo still exists in 7.x and later, but the field filesize is gone. I couldn't find any information in the code where it has gone.
I'm trying to use different Frontend-Layouts in TYPO3. So I'm using this fancy TypoScript:
page {
bodyTag = <body>
10= CASE
10.key.field=layout
# Standardtemplate
10.0 = TEMPLATE
10.0.template = FILE
10.0.template.file = fileadmin/template/content_template.html
10.0.workOnSubpart = DOCUMENT_BODY
# Variante 1:
10.1 = TEMPLATE
10.1.template = FILE
10.1.template.file = fileadmin/template/index_template.html
10.1.workOnSubpart = DOCUMENT_BODY
includeJSFooter {
jquery = fileadmin/template/js/jquery.js
bootstrap = fileadmin/template/js/bootstrap.min.js
app = fileadmin/template/js/app.js
}
includeCSS {
robotoFont = https://fonts.googleapis.com/css?family=Roboto:100,400
robotoFont.external = 1
robotoFont.media = all
bootstrapCore = fileadmin/template/css/bootstrap.min.css
bootstrapCore.media = all
}
}
This is not working yet. Every single page is completely. Only a white page appears. I'm using TYPO3 7.6.16. Is there any issue in my code above?
It think you are looking for this just place it in the PAGE-Element and rename the Path and also create some BackendLayouts named as value in layout 1. 2. 3. e.g. hope this will help:
10 = FLUIDTEMPLATE
10 {
file = fileadmin/templates/Page/Standard.html
partialRootPath = fileadmin/templates/Partials/
variables {
layout = CASE
layout {
key.field = backend_layout
key.ifEmpty.data = levelfield:-2, backend_layout_next_level, slide
1 = TEXT
1.value = startpage
2 = TEXT
2.value = subpage
3 = TEXT
3.value = subpagespecial
default = TEXT
default.value = subpage
}
content = CONTENT
content {
table = tt_content
select.orderBy = sorting
select.where = colPos=0
select.languageField = sys_language_uid
select.includeRecordsWithoutDefaultTranslation = 1
}
header = CONTENT
header {
table = tt_content
select.orderBy = sorting
select.where = colPos=1
select.languageField = sys_language_uid
select.includeRecordsWithoutDefaultTranslation = 1
}
content2 = CONTENT
content2 {
table = tt_content
select.orderBy = sorting
select.where = colPos=3
select.languageField = sys_language_uid
select.includeRecordsWithoutDefaultTranslation = 1
}
contentfull = CONTENT
contentfull {
table = tt_content
select.orderBy = sorting
select.where = colPos=2
select.languageField = sys_language_uid
select.includeRecordsWithoutDefaultTranslation = 1
}
}
}
Please add a default variant in the CASE object. It may be that pages which are created anew do not have a '0' in its 'layout' column.
Did you verify that the subpart markers are spelled correctly?
<!-- ###DOCUMENT_BODY### begin -->
Your HTML template
<!-- ###DOCUMENT_BODY### end -->
You could simplify your TypoScript template:
page {
10 = TEMPLATE
10.template = FILE
10.template.file = CASE
10.template.file {
key.field = layout
default = TEXT
default.value = fileadmin/template/content_template.html
1 = TEXT
value = fileadmin/template/index_template.html
}
10.workOnSubpart = DOCUMENT_BODY
}
I must set plugin.tt_news._DEFAULT_PI_VARS.tt_news to show the latest news by default. So I get the uid of the latest news via CONTENT.
temp.newsUid = CONTENT
temp.newsUid {
table = tt_news
select {
pidInList = 12345
orderBy = datetime DESC
join = tt_news_cat_mm ON tt_news_cat_mm.uid_local = tt_news.uid
where = tt_news_cat_mm.uid_foreign = 4711 AND tt_news.deleted = 0 AND tt_news.hidden = 0
max = 1
}
renderObj = COA
renderObj {
10 = TEXT
10.field = uid
}
}
plugin.tt_news._DEFAULT_PI_VARS.tt_news = temp.newsUid
will not work. But how can I do it?
This will work:
plugin.tt_news._DEFAULT_PI_VARS.tt_news.stdWrap.cObject < temp.newsUid
Here's the TypoScript code.
lib.membersList = CONTENT
lib.membersList{
table = tt_address
select{
pidInList = {$membersStorageFolder}
orderBy = zip, last_name
}
wrap = <div class="membersList">|</div>
renderObj = COA
renderObj{
10 = FLUIDTEMPLATE
10{
file = fileadmin/templates/ext/memberslist/templates/membersList.html
variables{
portrait = IMAGE
portrait{
file.import = uploads/pics/
file.import {
field = image
listNum = 0
}
file.height = 105
file.width = 105c
stdWrap.typolink{
parameter = {$membersPageId}
additionalParams.dataWrap = &ts_addresslist[showUid]={field:uid}
#returnLast = url
# The cache hash is needed to display the right content, since we are not running as USER_INT
useCacheHash = 1
}
}
lastName = TEXT
lastName.field = last_name
lastName.typolink{
parameter.data = TSFE:id
additionalParams.dataWrap = &ts_addresslist[showUid]={field:uid}
# The cache hash is needed to display the right content, since we are not running as USER_INT
useCacheHash = 1
}
firstName = TEXT
firstName.field = first_name
firstName.typolink{
parameter.data = TSFE:id
additionalParams.dataWrap = &ts_addresslist[showUid]={field:uid}
# The cache hash is needed to display the right content, since we are not running as USER_INT
useCacheHash = 1
}
title = TEXT
title.field = title
organisation = TEXT
organisation.field = company
country = TEXT
country.field = country
city = TEXT
city.field = city
}
}
}
stdWrap.override.cObject = CONTENT
stdWrap.override.cObject{
table = tt_address
select {
andWhere.data = GP:ts_addresslist|showUid
# Make sure there is no SQL injection!
andWhere.intval = 1
andWhere.wrap = uid=|
orderBy = last_name ASC
pidInList = {$membersStorageFolder}
}
wrap = <div class="membersDetail">|</div>
renderObj = FLUIDTEMPLATE
renderObj{
file = fileadmin/templates/ext/memberslist/templates/membersDetail.html
variables{
portrait = IMAGE
portrait{
file.import = uploads/pics/
file.import {
field = image
listNum = 0
}
file.height = 105
file.width = 105c
}
lastName = TEXT
lastName.field = last_name
firstName = TEXT
firstName.field = first_name
title = TEXT
title.field = title
organisation = TEXT
organisation.field = company
country = TEXT
country.field = country
city = TEXT
city.field = city
detail = TEXT
detail.field = description
}
}
renderObj.stdWrap.append = TEXT
renderObj.stdWrap.append{
value = << Back to list
typolink.parameter = {$membersPageId}
}
}
stdWrap.override.if {
isTrue.data = GP:ts_addresslist|showUid
isTrue.intval = 1
}
}
Everything is working fine. The list is displayed as it should. The detailed view also except for the last item. When I click on it, the detailed view displays a blank page. No information, as if the query fetched nothing.
Here are the templates, very simple though.
membersList.html
<section>
{portrait -> f:format.raw()}
<div class="memberDetail">
<h1>{lastName -> f:format.raw()} {firstName -> f:format.raw()}</h1>
<h2>{title} - {organisation}</h2>
<h3>{country} - {city}</h3>
</div>
</section>
membersDetail.html
<section>
{portrait -> f:format.raw()}
<div class="memberDetail">
<h1>{lastName} {firstName}</h1>
<h2>{title} - {organisation}</h2>
<h3>{country} - {city}</h3>
</div>
<div class="bio">
{detail}
</div>
</section>
Your code looks right so far. For debugging purpose add it directly to page object.
page.38388383 = CONTENT
page.38388383 {
table = tt_address
select{
pidInList = {$membersStorageFolder}
orderBy = zip, last_name
}
wrap = <div class="membersList">(|)</div>
renderObj = COA
renderObj{
10 = TEXT
10.field = uid
10.wrap = (|),
}
}
With this, you should get a comma separated list of all tt_address records without sideeffects. If that does not work, check on database level if everything is correct. Perhaps you some trouble with language, workspace or so...?
If this works like expected, you can replace your renderObj with this one and see what happens.
If expect that there is no crazy loop effect - but some CMS sideeffects (like missing rights, language, workspace version etc.).