[TYPO3-english] Getting sys_category into URL for Apache Solr

Bert Bert
Mon Aug 31 20:12:25 CEST 2015


Hello,

I tried like this:

typolink.additionalParams.cObject = COA
typolink.additionalParams.cObject {
	10 = CONTENT
	10 {
	table = tx_news_domain_model_news
	select {
	languageField = sys_language_uid
	uidInList.field = uid
	pidInList = {$categoriesPid}
	selectFields = sys_category.title
	join = sys_category_record_mm ON tx_news_domain_model_news.uid = 
sys_category_record_mm.uid_foreign JOIN sys_category ON sys_category.uid 
= sys_category_record_mm.uid_local
	where = sys_category_record_mm.tablenames = 'tx_news_domain_model_news'
	orderBy = sys_category.sorting
	max=1
	}
	renderObj = TEXT
	renderObj {
	field = title
	wrap = &lvl1=|
	}
	}

	20 < .10
	20.renderObj.wrap = &lvl2=|

	30 = TEXT
	30.value = &tx_news_pi1[news]={field:uid}&L={TSFE:sys_language_uid}
	30.insertData =1
}
...but values for "lvl1" and "lvl2" remain empty...
Any idea what I am doing wrong here? Am I on the right track?

Thanks in advance for any ideas!

Regards,
Bert Hiddink




On 8/31/15 10:55 AM, Bert Hiddink [BENDOO e-work solutions] wrote:
> Hello,
>
> Please see below for the snippet I use for indexing News with Apache
> Solr, works just fine.
>
> However, now I want to extend the url with the category and
> parent-category the news-item belongs to (I adapted already the partial
> for the detailview for that).
>
> Now, in order to have Apache Solr take these categories into account, I
> have to extend the URL-part for the typolink:
>   typolink.additionalParams =
> &parentCat={field:parentCat}&cat={field:cat}&tx_news_pi1[news]={field:uid}&L={TSFE:sys_language_uid}
>
>
> I guess I have to add a lookup by TS for the fields "cat" and
> "parentCat"...any pointers/ideas how to achieve this?
>
> Thanks in advance!
>
> Regards,
> Bert Hiddink
>
>
> ##Actual snippet for Apache Solr
> plugin.tx_solr.index.queue {
>    news = 1
>    news {
>      table = tx_news_domain_model_news
>      fields {
>        abstract = teaser
>        title = title
>        content = SOLR_CONTENT
>        content {
>          cObject = COA
>          cObject {
>            10 = TEXT
>            10 {
>              field = bodytext
>              noTrimWrap = || |
>            }
>            20 = TEXT
>            20 {
>              field = teaser
>            }
>          }
>        }
>        url = TEXT
>        url {
>          typolink.parameter = {$productDetailsPid}
>          typolink.additionalParams =
> &tx_news_pi1[news]={field:uid}&L={TSFE:sys_language_uid}
>          typolink.additionalParams.insertData = 1
>          typolink.useCacheHash = 1
>          typolink.returnLast = url
>        }
>      }
>    }
> }



More information about the TYPO3-english mailing list