How to get the result list working for records from other tables than pages or tt_content¶
Just take a look at the TS object browser.
You will find a working setup for pages at
plugin.tx_tagpack_pi3.10.taggedElements.pages
and another one for tt_content at
plugin.tx_tagpack_pi3.10.taggedElements.tt_content
Both will show some comments to explain how to add your own stuff after activating comments in the TSOB.
Now create your own like this:
This is just a simple example using the title of a news record to create links in <dl>-list style.
plugin.tx_tagpack_pi3.10.taggedElements {
recordLabels {
tt_news = results coming from tt_news
}
tt_news = COA
tt_news {
10 = TEXT
10 {
wrap = <dt>|</dt>
data = field:title
typolink {
parameter = 6
additionalParams.cObject = COA
additionalParams.cObject {
10 = TEXT
10.dataWrap = &tx_ttnews[tt_news]={field:uid}
20 = TEXT
20.data = field:datetime
20.date = Y
20.wrap = &tx_ttnews[year]=|
30 = TEXT
30.data = field:datetime
30.date = m
30.wrap = &tx_ttnews[month]=|
40 = TEXT
40.data = field:datetime
40.date = d
40.wrap = &tx_ttnews[day]=|
50 = TEXT
50.data = GPvar:tx_ttnews|cat
50.wrap = &tx_ttnews[cat]=|
}
}
}
}
}
Basically each record in the result list contains all the data of each available field of the table in
$this->cObj->dataand you can access them just as usual with stuff like
plugin.tx_tagpack_pi3.10.taggedElements {
tablename = COA
tablename {
10 = TEXT
10 {
wrap = <dt>|</dt>
data = field:fieldname
}
20 = TEXT
20 {
wrap = <dd>|</dd>
dataWrap = {field:fieldname} {field:fieldname}
}
}
}
This is a fully fledged and more complex example
It is using all options that are available including certain fields to search in (in case you activated the searchbox), the time fields to be used for the calendar and some additional filters that might be applied to records from a certain table as well (i.e. categories for tt_news).
plugin.tx_tagpack_pi3.10.taggedElements {
maxItems = 25
recordLabels {
tt_news = {$plugin.tx_tagpack_pi3.recordLabels.tt_news}
}
timeFields {
### uses the datetime field of tt_news for results within a certain timeframe
### tablename = comma,separated,list,of,fieldnames
tt_news = datetime
}
searchFields {
### the fields to include in the fulltext search
### tablename = comma,separated,list,of,fieldnames
tt_news = title,short,bodytext,author,author_email,keywords,ext_url,tx_timtab_trackbacks
}
additionalFilters {
### tablename {
### containing different parametersto be applied to the result list as well
### }
### The following example will only display tt_news results for a selected category
tt_news {
category {
GETvar = tx_ttnews
GETvar {
key = cat
}
mm_table = tt_news_cat_mm
foreign_table = tt_news_cat
label = TEXT
label {
lang.de = in dieser Kategorie
lang.en = in this category
}
}
}
}
### The render settings for records of a certain table
### The example will render tt_news records
tt_news = COA
tt_news {
### The title linking to the single View of tt_news
10 = TEXT
10 {
wrap = <dt>|</dt>
data = field:title
typolink {
parameter = 6
additionalParams.cObject = COA
additionalParams.cObject {
10 = TEXT
10.dataWrap = &tx_ttnews[tt_news]={field:uid}
20 = TEXT
20.data = field:datetime
20.date = Y
20.wrap = &tx_ttnews[year]=|
30 = TEXT
30.data = field:datetime
30.date = m
30.wrap = &tx_ttnews[month]=|
40 = TEXT
40.data = field:datetime
40.date = d
40.wrap = &tx_ttnews[day]=|
50 = TEXT
50.data = GPvar:tx_ttnews|cat
50.wrap = &tx_ttnews[cat]=|
}
}
}
### The description containing different parts
20 = COA
20 {
wrap = <dd class="blogpostinfo">|</dd>
### The category of the news record
10 = COA
10 {
10 = TEXT
10.value = Keine
10.override.cObject = COA
10.override.cObject {
10 = CONTENT
10 {
table = tt_news_cat
select {
pidInList = 16
andWhere.dataWrap = tt_news_cat_mm.uid_local={field:uid} AND tt_news_cat_mm.uid_foreign=tt_news_cat.uid
join = tt_news_cat_mm
}
renderObj = COA
renderObj {
10 = TEXT
10.field = title
10.noTrimWrap = |, ||
}
}
stdWrap.substring = 2,1000
}
10.wrap = Kategorie: | |
}
### The date (could be date and time as well) of the news record
20 = COA
20 {
10 = TEXT
10.data = field:datetime
10.date = d.m.Y
10.wrap =  Datum: | |
}
### The author of this record
30 = COA
30 {
10 = TEXT
10.dataWrap =  Von: {field:author}
10.fieldRequired = author
}
### The tags assigned to this record
40 = COA
40 {
### This will create a singleItem version of the tagcloud plugin
### Which is very useful if you activated the "filter mode" and
### want to find items related to the one you already found
10 < plugin.tx_tagpack_pi1.userFunc.renderObj
10 = COA
10.10 {
tableName = tt_news
singleItemCloud = 1
minFontSize = 10
maxFontSize = 10
maxNumberOfSizes = 10
linkBoxStdWrap.wrap = Schlagworte: <div class="tx-tagpack-pi1-linkbox">|</div>
linkBoxStdWrap.substring = 0,-14
linkStdWrap.wrap = <span>| |</span>
}
wrap = <div class="tx-tagpack-pi1-singleitemcloud">|</div>
}
### The image of the news record linking to the single view as well
50 = COA
50 {
10 = IMAGE
10 {
file {
import = uploads/pics/
import.listNum = 0
import.field = image
width = 125m
height = 125m
}
stdWrap.required = 1
stdWrap.typolink {
parameter = 6
additionalParams.cObject = COA
additionalParams.cObject {
10 = TEXT
10.dataWrap = &tx_ttnews[tt_news]={field:uid}
20 = TEXT
20.data = field:datetime
20.date = Y
20.wrap = &tx_ttnews[year]=|
30 = TEXT
30.data = field:datetime
30.date = m
30.wrap = &tx_ttnews[month]=|
40 = TEXT
40.data = field:datetime
40.date = d
40.wrap = &tx_ttnews[day]=|
50 = TEXT
50.data = GPvar:tx_ttnews|cat
50.wrap = &tx_ttnews[cat]=|
}
}
}
20 = TEXT
20.dataWrap = {field:short}
wrap = <div class="text">|</div>
}
### The more link
60 = TEXT
60 {
value = mehr
typolink {
parameter = 6
additionalParams.cObject = COA
additionalParams.cObject {
10 = TEXT
10.dataWrap = &tx_ttnews[tt_news]={field:uid}
20 = TEXT
20.data = field:datetime
20.date = Y
20.wrap = &tx_ttnews[year]=|
30 = TEXT
30.data = field:datetime
30.date = m
30.wrap = &tx_ttnews[month]=|
40 = TEXT
40.data = field:datetime
40.date = d
40.wrap = &tx_ttnews[day]=|
50 = TEXT
50.data = GPvar:tx_ttnews|cat
50.wrap = &tx_ttnews[cat]=|
}
}
}
}
}
}
You can see the results of this one here:
http://tags.4any1.de
Login with testuser/blogreader and check out the different options.
Of course this is just an example and you are not forced to do the whole stuff with TypoScript.
But since everything is based on standard TS objects, you can easily add your own functionality by creating a small extension that contains a set of functions you can apply via USER or USER_INT instead.