[TYPO3-Solr] Using tx_solr_viewhelper_AbstractSubpartViewHelper
Ingo Renner
ingo at typo3.org
Wed Oct 26 17:25:16 CEST 2011
Am 25.10.11 17:26, schrieb Heiko Kromm | Paints:
Hi Heiko,
> are there any examples on how to use the tx_solr_viewhelper_AbstractSubpartViewHelper?
> I found the tx_solr_viewhelper_Facet viewhelper, but I don't see how this works.
That's the only implementation of the subpart view helper currently.
> I would like to create a viewhelper for my custom indexed elements. I'm thinking about something like this:
>
> <!-- ###IF:###RESULT_DOCUMENT.TYPE###|==|myelement### begin -->
> <!-- ###MYELEM:###RESULT_DOCUMENT.UID###### begin -->
> <h1>###MYELEM_ITEM.title###</h1>
> ###MYELEM_ITEM.img###
> <!-- ###MYELEM:###RESULT_DOCUMENT.UID### ### end -->
> <!-- ###IF:###RESULT_DOCUMENT.TYPE###|==| myelement ### end -->
>
> MYELEM should be my own viewhelper and it should set the variable MYELEM_ITEM with data fetched from the database, depending on the uid submitted to the viewhelper.
The template object is set in $this->template, like in the facet
viewhelper, clone it, assign your variables and/or subparts and render
it. Then return the rendered result.
Ingo
--
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2, Admin Google Summer of Code
TYPO3 - Open Source Enterprise Content Management System
http://typo3.org
Apache Solr for TYPO3 -
Open Source Enterprise Search meets Open Source Enterprise CMS
http://www.typo3-solr.com
More information about the TYPO3-project-solr
mailing list