新手來TYPO3但學習。TYPO3 typoscript mySql select,獲得相同的db字段2次
我有這樣的代碼
lib.GetSubCat = CONTENT
lib.GetSubCat {
wrap = <div class="p_filter"><div class="p_filter_container"><a class="p_cat_filter button" href="#" title="Under Emne" data-filter="article.portfolio"><span>Under Emne</span></a><ul class="p_filter"><li class="current"><a href="#" title="Under Emne" data-filter="article.portfolio">Under Emne</a></li>|</ul></div><div class="cl"></div></div>
table = tx_tbpdrills_domain_model_drillsubcategory
select {
pidInList = 18
where = NOT deleted AND NOT hidden
orderBy = subcategorytitle ASC
}
renderObj = COA_INT
renderObj {
10 = TEXT
10.field = subcatshort
10.wrap = <li><a href="#" title="###" data-filter="article.portfolio[data-category~='###']">|</a></li>
}
}
做工精細,現在我想從我的數據庫添加一個額外的領域,我有這樣的代碼,它也正在努力。
......
table = tx_tbpdrills_domain_model_drillsubcategory
select {
pidInList = 18
where = NOT deleted AND NOT hidden
orderBy = subcategorytitle ASC
}
renderObj = COA_INT
renderObj {
10 = TEXT
10.field = subcatshort
10.wrap = <li><a href="#" title="###" data-filter="article.portfolio[data-category~='|']">
20 = TEXT
20.field = subcategorytitle
20.wrap = |</a></li>
}
}
現在的問題是,這是代碼行,以及我如何添加「subcategorytitle」的標題=「###」,所以我不需要做出3. 30 = TEXT和和同樣的領域從數據庫到這樣的時代,還是它的方式來做到這一點?
lib.GetSubCat = CONTENT
lib.GetSubCat {
wrap = <div class="p_filter"><div class="p_filter_container"><a class="p_cat_filter button" href="#" title="Under Emne" data-filter="article.portfolio"><span>Under Emne</span></a><ul class="p_filter"><li class="current"><a href="#" title="Under Emne" data-filter="article.portfolio">Under Emne</a></li>|</ul></div><div class="cl"></div></div>
table = tx_tbpdrills_domain_model_drillsubcategory
select {
pidInList = 18
where = NOT deleted AND NOT hidden
orderBy = subcategorytitle ASC
}
renderObj = TEXT
renderObj.stdWrap.htmlSpecialChars = 0
renderObj {
value = <li><a href="#" title="{field:subcategorytitle}" data-filter="article.portfolio[data-category~='{field:subcatshort}']">{field:subcategorytitle}</a></li>
insertData = 1
}
}
thx,可以看出它更容易的B方式.. 「insertData = 1」是做什麼的? –
引用:「對於花括號對來解析內容,花括號的內容是'getText'類型,並由'getText'的結果替代。」欲瞭解更多信息,請參閱** [文檔](http://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Stdwrap/Index.html#stdwrap-insertdata)**。 – tmt
好的.. thx,和我的3.編輯前。代碼可以嗎?或者我需要一些改變/修復,因此它會以最好的方式工作! –