Select with TypoScript with condition - select

I got this condition:
[globalVar = TSFE:fe_user|sesData|get_car = Katowice]
get_carpid = TEXT
get_carpid.value = 27
[global]
And this select:
plugin.Tx_Formhandler.settings.predef.formhandler-multistep-forms.markers.input_readonly_a_price = CONTENT
plugin.Tx_Formhandler.settings.predef.formhandler-multistep-forms.markers.input_readonly_a_price {
table = tx_pricelist_prices_full
select {
pidInList = 27
orderBy = uid
selectFields = uid, group_a_1_3
# possible conditions
where = ( tx_pricelist_prices_full.uid='1' AND hidden='0' AND deleted='0')
}
renderObj = COA
renderObj {
#value
1 = TEXT
1.insertData = 1
1.data = field:group_a_1_3
2 = TEXT
2.value = *
3 = TEXT
3.insertData = 1
3.data = TSFE:fe_user|sesData|finish_day
stdWrap.prioriCalc = 1
}
}
How to use defined get_carpid in SELECT in line pidInList = get_carpid
Thanks for any help!

You can create a cObject CASE. But this will only work for [a-zA-z0-9_-]
# TS Setup
... snip ...
pidInList.cObject = CASE
pidInList.cObject {
key.data = TSFE:fe_user|sesData|get_car
key.case = lower
default = TEXT
default.value = 0
# special chars are not allowed
katowice = TEXT
katowice.value = 27
}
... snip ...
A different possibility is to use constants:
# TS Constants
[globalVar = TSFE:fe_user|sesData|get_car = Katowice]
get_carpid = 27
[globalVar = TSFE:fe_user|sesData|get_car = Lublin]
get_carpid = 28
[global]
# TS Setup
... snip ...
pidInList = {$get_carpid}
... snip ...
The first solution is more TypoScript fun, the second easier for novice - i guess :)

Related

Why does noTrimWrap not work in the following TypoScript?

Wrap works, but need the spaces for better presentation, unfortunately it doesn't work with "noTrimWrap" :-(
I use Typo3 9.5.10
I hope someone can help me :-)
myTicker = CONTENT
myTicker {
wrap = |
table = tx_myPlugin_domain_model_tick
select {
pidInList = 31
max = 4
selectFields = dbfield_1, dbfield_2
}
renderObj = COA
renderObj {
10 = TEXT
10.field = dbfield_1
20 < .10
20.field = dbfield_2
noTrimWrap = |<div>+++ Neuer Eintrag: | +++</div>|
}
}
COA does not have a direct stdWrap on the root level. This should work though:
myTicker = CONTENT
myTicker {
wrap = |
table = tx_myPlugin_domain_model_tick
select {
pidInList = 31
max = 4
selectFields = dbfield_1, dbfield_2
}
renderObj = COA
renderObj {
10 = TEXT
10.field = dbfield_1
20 < .10
20.field = dbfield_2
stdWrap.noTrimWrap = |<div>+++ Neuer Eintrag: | +++</div>|
}
}

Get list of feusers with typoscript, can't get the names of the associated usergroups

I am generating this list of feusers and trying to get the names of the associated usergroups. This code worked before the update to TYPO3 8.x (it's just the relevant part of the whole thing):
40 = TEXT
40.field = usergroup
40.split {
token = ,
cObjNum = 1 || 2
1 {
10 = CONTENT
10.table = fe_groups
10.select.pidInList = 22
10.select.andWhere.current = 1
10.select.andWhere.wrap = uid=|
10.select.where = (title NOT LIKE 'Netzwerk')
10.renderObj = TEXT
10.renderObj.field = title
10.renderObj.wrap = |, <br />
}
2 < .1
2.10.renderObj.wrap >
}
With TYPO3 8 the 'andWhere' is depreciated and so I tried like this, but failed:
40 = TEXT
40.field = usergroup
40.split {
token = ,
cObjNum = 1 || 2
1{
10 = CONTENT
10 {
table = fe_groups
select {
pidInList = 22
where.current = 1
where.wrap = uid= |
}
10.renderObj = TEXT
10.renderObj.field = title
10.renderObj.wrap = |,
}
2 < .1
2.10.renderObj.wrap
}
}
Thanks for pointing me in the right direction.
You should not split up the comma separated values, but go for uidInList instead. This way you get rid of the surrounding split and fetch the elements within just one go.
40 = CONTENT
40 {
table = fe_groups
select {
uidInList.field = usergroup
pidInList = 22
}
renderObj = TEXT
renderObj.field = title
renderObj.wrap = |,
}

TYPO3 ignores Language in categories select

I am selecting categories on an English page. The categories have the language ID 0. English is ID 1.
But I need the same categories on both languages.
cheese = CONTENT
cheese {
wrap = <cheese_legend>|</cheese_legend>
table = sys_category
select {
pidInList = {$categories}
selectFields = *
where = deleted = 0
andWhere = sys_language_uid = 0
andWhere = hidden = 0
}
renderObj = COA
renderObj {
wrap = <cat>|</cat>
10 = TEXT
10 {
stdWrap.field = uid
stdWrap.wrap = <div>|</div>
}
20 = TEXT
20 {
stdWrap.field = title
stdWrap.wrap = <div>|</div>
}
30 = TEXT
30 {
stdWrap.field = sys_language_uid
stdWrap.wrap = <div>|</div>
}
}
}
So I'm explicitly selecting the sys_language_uid = 0!!
But nevertheless the script only gives me results with the ID = 1.
Any idea to make this baby work?
You have doubled the andWhere = statement, so the one below overwrites the one above.
Use andWhere = sys_language_uid = 0 AND hidden = 0 in one line.
For getting the english ones you use andWhere = sys_language_uid = 1 AND hidden = 0.

TYPO3 title tag from page title and tt_news category title

I have couple of tt_news category items and subpages on which these categories belong, for example:
www.example.com/typo3/category/typoscript.html - id=1
www.example.com/other/category/seo.html - id=2
I have following TS who "connect" page title and category name:
[globalVar = TSFE:id = 1]
temp.newsTitle = RECORDS
temp.newsTitle {
source = {GP:tx_ttnews|cat}
source.insertData = 1
tables = tt_news_cat
conf.tt_news_cat >
conf.tt_news_cat = TEXT
conf.tt_news_cat.field=title
wrap = <title>TYPO3 -|</title>
}
page.config.noPageTitle = 2
page.headerData.30 >
page.headerData.30 < temp.newsTitle
[global]
[globalVar = TSFE:id = 2]
temp.newsTitle = RECORDS
temp.newsTitle {
source = {GP:tx_ttnews|cat}
source.insertData = 1
tables = tt_news_cat
conf.tt_news_cat >
conf.tt_news_cat = TEXT
conf.tt_news_cat.field=title
wrap = <title>Other -|</title>
}
page.config.noPageTitle = 2
page.headerData.30 >
page.headerData.30 < temp.newsTitle
[global]
In output the title of pages looks like this:
TYPO3 - TypoScript
Other - SEO
Is it possible to connect those two values globally (without globalVar = TSFE:id = 3)?
I try with these but it didn't work:
[globalVar = GP:tx_ttnews|cat > 0]
lib.newsTitle = COA
lib.newsTitle {
10 = TEXT
10.field = title
10.noTrimWrap = ||: |
20 = RECORDS
20 {
source = {GP:tx_ttnews|cat}
source.insertData = 1
tables = tt_news_cat
conf.tt_news_cat >
conf.tt_news_cat = TEXT
conf.tt_news_cat.field=title
}
wrap = <title>|</title>
}
page.config.noPageTitle = 2
page.headerData.30 >
page.headerData.30 < temp.newsTitle
[global]
What about insertData in the wrap?
temp.newsTitle = RECORDS
temp.newsTitle {
source = {GP:tx_ttnews|cat}
source.insertData = 1
tables = tt_news_cat
conf.tt_news_cat >
conf.tt_news_cat = TEXT
conf.tt_news_cat.field=title
stdWrap.wrap = <title>{page:title} -|</title>
stdWrap.insertData = 1
}
If it works, maybe even try without stdWrap.

Typo3: Can't remove link from YAML-Header in

Like the title says I have a website made with Typo3. I have a link in the yaml-header an can't remove it, because I don't find where it is added.
I know that in Template View on the Root Page in the Constant Editor the sites displayed there can be edited:
And I also know that it's possible to add some links with Typo-Script, looks similar to that I think:
lib.header.20.30 = TEXT
lib.header.20.30.value = Link1 Name
lib.header.20.30.typolink.parameter = http://link1.ziel
The Problem is, that I don't find the link I want to remove not in the headernavigationincludelist neither in the Typo-Script.
Constants:
### Change message, if user did not fill out mandatory fields:
styles.content.mailform.badMess = Leere Pflichtfelder:
[globalVar = GP:L = 1]
styles.content.mailform.badMess = You must fill in these fields:
[global]
[globalVar = GP:L = 2]
styles.content.mailform.badMess = Change Me:
[global]
### Change settings of Dropdown Sitemap extension:
plugin {
tx_dropdownsitemap_pi1 {
picture {
params = hspace="5" vspace="0" border="0"
}
}
}
### Begin of standard constants
### Only Yes/No options are listed here, for others see constant editor.
## searchbox
searchBoxOff = 0
## header
topNavOff = 0
firstHeaderImageOff = 0
secondHeaderImageOff = 0
linkFirstImageToggle = 1
noGifBuilderForFirstHeaderImage = 1
noGifBuilderForSecondHeaderImage = 1
## teaser
teaserOff = 1
rootlineOff = 0
languageMenuOff = 0
fontSizeSelectorOff = 0
dateAndTimeOff = 0
## basics
selectorBoxOff = 0
tabNavigationOff = 0
subMenuOff = 0
menuHeadlineOff = 1
subMenuExpandToggle = 0
footerOff = 0
## languages
languageLocaleStandardLang = german
languageLocaleFirstLang = english
languageLocaleSecondLang = french
languageIsoCodeStandardLang = de
languageIsoCodeFirstLang = en
languageIsoCodeSecondLang = fr
## headlines
replaceH1withImage = 0
replaceH2withImage = 0
replaceH3withImage = 0
replaceH4withImage = 0
replaceH5withImage = 0
## statistics
statisticsSetting = 0
statApacheSetting = 0
statMysqlSetting = 0
## expert settings
userAdmPanelOn = 1
userIndexingOn = 1
userIndexExternalsOn = 0
userDisablePrefComm = 0
yamlDebugOn = 0
yamlFillerLinkOn = 0
footerFirstLangHtmlCode = <div class="left">Born Informatik AG, Berner Technopark, Morgenstrasse 129, CH-3018 Bern</div><div class="right">Copyright © 2008 Born Informatik AG</div>
footerStandardLangHtmlCode = <div class="left">Born Informatik AG, Berner Technopark, Morgenstrasse 129, CH-3018 Bern</div><div class="right">Copyright © 2008 Born Informatik AG</div>
footerSecondLangHtmlCode = <div class="left">Born Informatik AG, Berner Technopark, Morgenstrasse 129, CH-3018 Bern</div><div class="right">Copyright © 2008 Born Informatik AG</div>
searchPagePID = 32
plugin.tt_news.archiveTypoLink.parameter = 32
styles.content.imgtext.maxW = 410
plugin.wtsnowstorm.pid = 1,1
plugin.tx_srlanguagemenu_pi1.showCurrent = 0
plugin.meta = name=google-site-verification
headerNavigationIncludeList = 128, 31, 33, 34
TSConstantEditor.yaml-header.5 = topNavOff, headerNavigationIncludeList
Setup:
###############################
# Delete default styles of
# Plugin dropdown sitemap
###############################
plugin.tx_dropdownsitemap_pi1._CSS_DEFAULT_STYLE >
###############################
# Delete default styles of
# cssstyledcontent (Copied to content.css, in order to be able to modify them there.)
###############################
plugin.tx_cssstyledcontent._CSS_DEFAULT_STYLE >
###############################
# Configuration of Statistics
###############################
page.headerData.100 < plugin.tx_kestats_pi1
###############################
# metatags-config
# Insert your own data here.
###############################
plugin.meta {
flags.useSecondaryDescKey = 0
flags.alwaysGlobalDescription = 1
flags.alwaysGlobalKeywords = 1
global.author = Born Informatik AG
global.email =
global.copyright = Born Informatik AG
global.keywords = Born Informatik AG
global.description = Born Informatik AG
global.revisit = 2 days
global.robots = index,follow
global.language = {$languageIsoCodeStandardLang}
}
#### Change language, keywords and description for first foreign language
[globalVar = GP:L = {$firstForeignLanguage}]
plugin.meta.global.language = {$languageIsoCodeFirstLang}
plugin.meta.global.keywords = my keywords for first foreign language
plugin.meta.global.description = my description for first foreign language
[global]
#### Change language, keywords and description for second foreign language
[globalVar = GP:L = {$secondForeignLanguage}]
plugin.meta.global.language = {$languageIsoCodeSecondLang}
plugin.meta.global.keywords = my keywords for second foreign language
plugin.meta.global.description = my description for second foreign language
[global]
page.headerData.999 < plugin.meta
###############################
# Configuration of newloginbox
###############################
plugin.tx_newloginbox_pi1._CSS_DEFAULT_STYLE >
plugin.tx_newloginbox_pi3._CSS_DEFAULT_STYLE >
###############################
# Configuration of tt_news
###############################
plugin.tt_news {
_CSS_DEFAULT_STYLE >
usePagesRelations = 1
usePiBasePagebrowser = 1
archiveTitleCObject {
10.strftime = %B - %Y
}
getRelatedCObject {
10.1.20.strftime = %d.%m.%y %H:%M
10.2.20.strftime = %d.%m.%y %H:%M
10.default.20.strftime = %d.%m.%y %H:%M
}
displaySingle {
date_stdWrap.strftime= %d.%m.%Y
time_stdWrap.strftime= %H:%M
age_stdWrap.age = Minuten | Stunden | Tage | Jahre
}
displayLatest {
date_stdWrap.strftime= %d.%m.%y
time_stdWrap.strftime= %H:%M
}
displayList {
date_stdWrap.strftime= %A %d. %B %Y
time_stdWrap.strftime= %d.%m.%y %H:%M
}
}
plugin.tt_news {
catOrderBy = title
displayCatMenu {
catmenuRootIconFile = EXT:tt_news/res/tt_news_cat.gif
catmenuNoRootIcon = 0
catmenuIconMode = -1
}
}
plugin.tt_news {
pageBrowser {
dontLinkActivePage = 1
maxPages = 10
showRange = 0
showPBrowserText = 1
showResultCount = 0
showFirstLast = 0
}
}
plugin.tt_news.displayLatest.subheader_stdWrap.crop = 100 | ... | 1
#### Change news-settings for first foreign language
[globalVar = GP:L = {$firstForeignLanguage}]
plugin.tt_news.getRelatedCObject.10.1.20.strftime = %d.%m.%y %H:%M
plugin.tt_news.getRelatedCObject.10.2.20.strftime = %d.%m.%y %H:%M
plugin.tt_news.getRelatedCObject.10.default.20.strftime = %d.%m.%y %H:%M
plugin.tt_news.displaySingle.date_stdWrap.strftime= %d.%m.%Y
plugin.tt_news.displaySingle.time_stdWrap.strftime= %H:%M
plugin.tt_news.displaySingle.age_stdWrap.age = Minutes | Hours | Days | Years
plugin.tt_news.displayLatest.date_stdWrap.strftime= %m/%d/%y
plugin.tt_news.displayLatest.time_stdWrap.strftime= %H:%M
plugin.tt_news.displayList.date_stdWrap.strftime= %A %d. %B %Y
plugin.tt_news.displayList.time_stdWrap.strftime= %d.%m.%y %H:%M
[global]
#### Change news-settings for second foreign language
[globalVar = GP:L = {$secondForeignLanguage}]
plugin.tt_news.displaySingle.age_stdWrap.age = Minutes | Heures | Jours | Ans
[global]
################################
# Configuration of indexedsearch
################################
plugin.tx_indexedsearch {
_CSS_DEFAULT_STYLE >
_DEFAULT_PI_VARS.results = 10
forwardSearchWordsInResultLink = 1
blind {
type=-1
defOp=0
sections=0
media=1
order=-1
group=-1
extResume=-1
lang=-1
desc=-1
results=0
}
show {
rules=0
parsetimes=1
L2sections=1
L1sections=1
LxALLtypes=0
clearSearchBox = 0
clearSearchBox.enableSubSearchCheckBox=0
}
search {
rootPidList =
}
}
## CSS for rgtabs was moved and edited in content.css
plugin.tx_rgtabs_pi1.pathToCSS >
lib.nav.20.1.wrap = <ul><li class="home"><span>Home</span></li>|</ul>
lib.nav.20.1.ACT.allWrap = <li class="active">|</li>
lib.nav.20.wrap = <div id="navmain">|</div>
lib.nav.20.excludeUidList = 2
lib.submenu.10.30.1.ACTIFSUB = 1
lib.submenu.10.30.1.ACTIFSUB.allWrap = <strong>|</strong><span class="hidden">.</span>
lib.submenu.10.30.1.ACTIFSUB >
lib.submenu.10.20.wrap = <li id="title">|</li><li id="separator">|</li>
plugin.tt_news.displayList.date_stdWrap.strftime = %d.%m.%Y
page.headerData.19 = TEXT
page.headerData.19.value = <link rel="SHORTCUT ICON" href="http://born.ch/fileadmin/img/icons/favicon.ico">
page.headerData.19.value = <link rel="SHORTCUT ICON" href="fileadmin/img/icons/favicon.ico">
#awstats congig
config.stat = 1
config.stat_apache = 1
config.stat_apache_logfile = intranet.log
# SNOWFLAKES!!
snowstorm = PAGE
snowstorm {
typeNum = 3136
10 < plugin.tx_wtsnowstorm
config {
disableAllHeaderCode = 1
disablePrefixComment = 1
xhtml_cleaning = 0
admPanel = 0
}
}
# Add javascript file to html header
page.headerData.3136 = TEXT
page.headerData.3136 {
wrap = <script src="|" type="text/javascript"></script>
typolink.parameter.data = page : uid
typolink.additionalParams = &type=3136
typolink.addQueryString = 1
typolink.returnLast = url
}
page.10 >
page.headerData.28.value = <script type="text/javascript" src="fileadmin/scripts/jquery-1.3.2.min.js"></script>
lib.footer.100.value = <div class="left">Born Informatik AG, Berner Technopark, Morgenstrasse 129, CH-3018 Bern</div><div class="right">Copyright © 2008-2011 Born Informatik AG</div>
config.sys_language_overlay = 1
lib.header.20.30 < lib.teaser.20.10
lib.header.20.30.languagesUidsList = 0,2
lib.header.20.30.defaultLayout = 2
lib.header.20.30.flag.CUR.doNotLinkIt = 1
lib.header.20.30.link.CUR.doNotLinkIt = 1
lib.header.20.30.links.CUR.doNotLinkIt = 1
lib.header.20.30.link.NO.stdWrap.wrap = | <div class="NO"> | </div>
page.headerData.2 = TEXT
page.headerData.2.insertData=1
page.headerData.2.case=lower
page.headerData.2.wrap = <meta name="google-site-verification" content="zc2lFQCXoXPUZrGCU-axHs4hoYSvruh2UsU9WgM_6VE">
page.headerData.3 = TEXT
page.headerData.3.insertData=1
page.headerData.3.case=lower
page.headerData.3.wrap = <meta name="google-site-verification" content="KCjWqRAjA0I77QRa9C909EPmEuX-UXb3vO213VBZeEg">
The link I want to remove ist the first one, the Intranet link:
Thanks in advance, if you need more infos to Help me just say what you need.
You surely have cleared the cache, I guess?
I'm wondering why in your listed TS constants there are five page-ids:
headerNavigationIncludeList = 30, 128, 31, 33, 34
The 30 is the ID of page "Intranet", I guess. It seems, your editing of the constants via the "Constant Editor" was not successful.