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
}
}
}
}
Related
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 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
I try to get an author of a Typo3 site and after this i try to fill a Typo3 select (typoscript) with the resulting ID.
Its somehow working, but i can not use the lib oder variable as datasource of another select
I tryed to play arround with LOAD_REGISTER or marker. But i think it has to be a way to use a select result or another "lib" result in a select.
Here is my code:
// Returns succsessfully "neuz8" and i can use this in fluid
lib.author = TEXT
lib.author.data = page:author
lib.Authornavigation = CONTENT
lib.Authornavigation {
stdWrap.required = 1
table = be_users
select {
uidInList = 0
pidInList = root
selectFields = be_users.uid as id, be_users.realName as rn, be_users.profile_pid as prid
where = be_users.profile_pid != '0'
andWhere = be_users.realName={lib.author} // Is not working, why?
// I tryed: combinations of andWhere.data or lib.author.data,
// with and without {},
// with LOAD_REGISTER,
// with "markers",
//andWhere = be_users.realName='neuz8' < this works and returns "39", the correct ID
andWhere.wrap =
markers {
//author.data = {page:author}
}
}
renderObj = COA
renderObj {
10 = TEXT
10.field = prid
10.wrap2 = ###SPLITTER### |
}
stdWrap.split {
token = ###SPLITTER###
cObjNum = 1 |*| 2 |*| 1
1.current = 1
2.current = 1
2.wrap = |,
}
}
This should work
replace
// andWhere = be_users.realName={lib.author} // Is not working, why?
with
andWhere = be_users.realName=
andWhere.postCObject < temp.author
You can try select.markers:
page.60 = CONTENT
page.60 {
table = tt_content
select {
pidInList = 73
where = header != ###whatever###
orderBy = ###sortfield###
markers {
whatever.data = GP:first
sortfield.value = sor
sortfield.wrap = |ting
}
}
}
Docs » Functions » select (see part markers)
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
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.).