Hi everyone,
I got a typoscript that renders a certain type of content element with fluid like that:
`tt_content.recentlyCommentedPagesListing =< lib.contentElement
tt_content.recentlyCommentedPagesListing {
templateName = Listing
templateRootPaths {
10 = EXT:angularcli_suite/Resources/Private/Templates/RecentlyCommentedPages
}
partialRootPaths {
10 = EXT:angularcli_suite/Resources/Private/Partials/RecentlyCommentedPages
}
variables {
listing < lib.recentlyCommentedPages
containerListing < lib.recentlyCommentedPages_In_Container
images < lib.recentlyCommentedPages_Images
typo3Host < lib.WaXCode_AngularCLISuite_AppMenu_Viewer_typo3Host
}
}`
Within the very same typoscript Iām using a select to generate the content for the variable ālistingā which is than passed by the fluid-template to an angular component:
`lib.recentlyCommentedPages = CONTENT
lib.recentlyCommentedPages {
table = pages
wrap = |
select {
orderBy = content.xc_recently_commented_pages_comment_time DESC
max = 15
join = tt_content content ON content.pid = pages.uid AND content.xc_recently_commented_pages_comment != '' AND content.xc_recently_commented_pages_comment_time <= CURRENT_TIMESTAMP() AND content.deleted = 0 AND content.hidden = 0 AND ( content.starttime = 0 OR content.starttime <= UNIX_TIMESTAMP()) AND ( content.endtime = 0 OR content.endtime >= UNIX_TIMESTAMP()) AND ###VALID### LIKE CONCAT( '%', content.fe_group,'%')
markers {
VALID.data = TSFE:fe_user|user|usergroup
}
pidInList = 1
recursive = 10
selectFields = slug, content.uid AS content_uid, content.xtension_script, content.xtension_css_selector, content.bodytext, content.xc_recently_commented_pages_comment, content.xc_recently_commented_pages_comment_time, content.xtension_feed_configuration, content.xc_searchbar_inlineview_disallowed, content.xc_searchbar_inlineview_max_disallowed
}
renderObj = COA
renderObj {
10 = TEXT
10 {
field = xc_recently_commented_pages_comment_time
strtotime = 1
strftime = %d.%m.%Y
wrap = {<<<Ā°>>>timeOfComment<<<Ā°>>>:<<<Ā°>>>|<<<Ā°>>>,
}
11 = TEXT
11 {
field = slug
wrap = <<<Ā°>>>slug<<<Ā°>>>:<<<Ā°>>>|<<<Ā°>>>,
}
12 = TEXT
12 {
field = content_uid
wrap = <<<Ā°>>>uid<<<Ā°>>>:<<<Ā°>>>|<<<Ā°>>>,
}
13 = TEXT
13 {
field = bodytext
wrap = <<<Ā°>>>bodytext<<<Ā°>>>:<<<[>>>|<<<]>>>,
}
14 = TEXT
14 {
field = xc_recently_commented_pages_comment
wrap = <<<Ā°>>>comment<<<Ā°>>>:<<<Ā°>>>|<<<Ā°>>>,
}
15 = TEXT
15 {
field = xc_searchbar_inlineview_disallowed
wrap = <<<Ā°>>>disallowed<<<Ā°>>>:<<<Ā°>>>|<<<Ā°>>>,
}
16 = TEXT
16 {
field = xtension_feed_configuration
wrap = <<<Ā°>>>feed<<<Ā°>>>:<<<Ā°>>>|<<<Ā°>>>,
}
17 = TEXT
17 {
field = xtension_script
wrap = <<<Ā°>>>xscript<<<Ā°>>>:<<<Ā°>>>|<<<Ā°>>>,
}
18 = TEXT
18 {
field = xtension_css_selector
wrap = <<<Ā°>>>css_selector<<<Ā°>>>:<<<[>>>|<<<]>>>,
}
19 = TEXT
19 {
field = xc_searchbar_inlineview_max_disallowed
wrap = <<<Ā°>>>disallowedMax<<<Ā°>>>:<<<Ā°>>>|<<<Ā°>>>}<<<^>>>
}
}
}`
Within that select I need to modify the ājoinā-clause so that every found element will only be listet if itās pageās slug contains a string stored in a field in tt_content of the content element that is currently being processed.
Basically I need to get the value of a tt_content-field of the content element that the typoscript is currently rendering. I canāt seem to find a way to access the content elementās fields, though. For example I tried accessing it via lib.contentElement.data.fieldName but that didnāt work or I tried to do it the wrong way.
Can someone help me out on this?