[TYPO3-formidable] generating a searchform with single view
Luc Muller
l.mul-nospam-ler at ameos.com
Fri Aug 13 09:29:19 CEST 2010
Great :)
Next step is paginating records ;)
and templating pagination.
Luc
Le 13/08/2010 09:22, Domi Garms a écrit :
> Thanks Luc,
>
> it was the naming what I did wrong (Thanks to Koen again!). But good
> for the hint with ROWS1+ROW2, much easier for layouting odd and even
> rows.
>
> <renderlet:LISTER name="mylister">
> <searchform use="search_aupair" />
>
> <template
> path="EXT:dmf_aupairs/ressources/html/aupair_search.html"
> subpart="###mylister###"
> alternateRows="###ROW1###,###ROW2" />
> <pager>
> <template
> path="EXT:dmf_aupairs/ressources/html/aupair_search.html"
> subpart="###mylisterpager###" />
> <rows perpage="-1" />
> <window>2</window>
> </pager>
>
> <ifEmpty>
> <message>There are no search results</message>
> </ifEmpty>
> <columns>
>
>
> <!-- ###mylister### begin-->
> <table class="lister" cellspacing="0" cellpadding="0">
> <caption>
> <strong>{mylister.pager.numrows} results</strong>
> </caption>
> <tr>
> <th></th>
> </tr>
> <!-- ###ROWS### begin-->
>
> <!-- ###ROW1### begin-->
> <tr class="even">
> <td>{country.value}</td>
> <td>{crdate.value.readable}</td>
> </tr>
> <!-- ###ROW1### end-->
>
> <!-- ###ROW2### begin-->
> <tr class="odd">
> <td>{country.value}</td>
> <td>{crdate.value.readable}</td>
> </tr>
> <!-- ###ROW2### end-->
>
> <!-- ###ROWS### end-->
>
> <!-- ###mylister### end-->
>
> Greetings
>
> Domi
>
>
>
>
> 2010/8/13 Luc Muller<l.mul-nospam-ler at ameos.com>:
>> Hi Domi.
>>
>> Ni try, you were close of it I think.
>>
>> try this :
>>
>> <!-- ###SEARCHLIST### begin-->
>> <!-- ###ROWS### begin-->
>> <!-- ###ROW### begin-->
>> {firstname}
>> <!-- ###ROW### end-->
>> <!-- ###ROWS### end-->
>> <!-- ###SEARCHLIST### end-->
>>
>> but not sure that {aupair_list.debug()} will work because lister is
>> substitued by the ###SEARCHLIST### and not aupair_list
>>
>> Some tips.
>>
>> - when you use templates subparts sur as : ###SEARCHLIST### you'd better use
>> your renderlet form as subpart label eg ###aupair_list### this way when you
>> look at your template you exactly know which lister represent the subpart.
>> - when using rows like ###ROW### use ###ROW1### this is going to be easier
>> if you use multiple rows rendering ###ROW1###,###ROW2###
>>
>> Hope this will work, as I'm responding without a try :p
>>
>> Luc =:0)
>>
>>
>> Le 13/08/2010 08:06, Domi Garms a écrit :
>>>
>>> Good mornig everybody. Im trying now for hours why the LISTER in a
>>> renderer:TEMPLATE doesnt shows up anymore. I followed the instructions
>>> of
>>>
>>> http://formidable.typo3.ug/typo3-form-news/news/0012-how-to-use-an-advanced-pager-for-the-listers/back/2.html
>>> and the following snippets. The searchform is shown correctly, but my
>>> lister is empty. If I open it with renderer:STANDARD it is working
>>> correctly...
>>>
>>> XML:
>>> (...)
>>> <renderer:TEMPLATE>
>>> <template>
>>>
>>> <path>EXT:dmf_aupairs/ressources/html/aupair_search.html</path>
>>> <subpart>###FORM###</subpart>
>>> <errortag>errors</errortag>
>>> </template>
>>> </renderer:TEMPLATE>
>>> (...)
>>>
>>> <elements>
>>> <renderlet:SEARCHFORM name="search_aupair">
>>> <datasource use="aupair_users" />
>>>
>>> <template
>>>
>>> path="EXT:dmf_aupairs/ressources/html/aupair_search.html"
>>> subpart="###SEARCHFORM###" />
>>>
>>>
>>> <childs>
>>> <renderlet:LISTBOX name="se_gender"
>>> label="We search for:">
>>> <search onfields="fe_users.gender"
>>> />
>>> <data>
>>> <defaultvalue first="true"
>>> />
>>> <items>
>>> <item caption="ALL"
>>> value="" />
>>> <item
>>> caption="male" value="0" />
>>> <item
>>> caption="female" value="1" />
>>> </items>
>>> </data>
>>> </renderlet:LISTBOX>
>>> (...)
>>> <renderlet:LISTER name="aupair_list">
>>> <searchform use="search_aupair" />
>>>
>>> <template
>>>
>>> path="EXT:dmf_aupairs/ressources/html/aupair_search.html"
>>> subpart="###SEARCHLIST###"
>>> alternateRows="###ROW###" />
>>> <pager>
>>> <template
>>>
>>> path="EXT:dmf_aupairs/ressources/html/aupair_search.html"
>>> subpart="###LISTPAGER###" />
>>> <rows perpage="2" />
>>> <window>2</window>
>>> </pager>
>>>
>>> <ifEmpty>
>>> <message>There are no search results</message>
>>> </ifEmpty>
>>> <columns>
>>> <column name="firstname"
>>> type="renderlet:LINK" listHeader="newtest">
>>> (...)
>>> HTML:
>>>
>>> <!-- ###FORM### begin-->
>>> .
>>> <!-- ###SEARCHFORM### begin-->
>>> <div class="searchform_elements">
>>>
>>> <div>{search_aupair.childs.se_country.label}</div>
>>> <span>{search_aupair.childs.se_country.input}</div>
>>>
>>> <div>{search_aupair.childs.se_gender.label}</div>
>>> <div>{search_aupair.childs.se_gender.input}</div>
>>> <div>{search_aupair.childs.se_submit}</div>
>>>
>>> </div>
>>> <!-- ###SEARCHFORM### end-->
>>>
>>>
>>> <!-- ###SEARCHLIST### begin-->
>>>
>>> {aupair_list.debug()}
>>> <!-- ###ROWS### begin-->
>>>
>>> <!-- ###ROW### begin-->
>>>
>>>
>>> <!-- ###ROW### end-->
>>>
>>> <!-- ###ROWS### end-->
>>>
>>> <!-- ###SEARCHLIST### end-->
>>>
>>>
>>> Thanks for any help!
>>>
>>> Greetings,
>>>
>>> Domi
>>>
>>>
>>> 2010/8/12 Domi Garms<djgarms at gmail.com>:
>>>>
>>>> Sure Im using still the STANDARD renderer, coz not everything is set
>>>> up...I didnt went that far with formidable, so the template rendering
>>>> is my next step.
>>>>
>>>> Thanks a lot for your help!
>>>>
>>>>
>>>> Greetings
>>>>
>>>> domi
>>>>
>>>> 2010/8/12 Luc Muller<l.mul-nospam-ler at ameos.com>:
>>>>>
>>>>> Hmmmm... a think you should have a column type renderlet:IMAGE (
>>>>> http://formidable.typo3.ug/reference/elements/renderletimage.html ) and
>>>>> using a template to render your lister.
>>>>>
>>>>> This way you can use your standard renderlet:LINK in your template like
>>>>> this
>>>>> :
>>>>> {yourlink.tag.begin}{yourimage}{yourlink.tag.end}
>>>>> another way to achieve the same thing (but you have to be sure that
>>>>> THERE IS
>>>>> a link for each items
>>>>> <a href="{yourlink.url}">{yourimage}</a>
>>>>>
>>>>> you'll have several clues using in your template yourrenderlet.debug()
>>>>>
>>>>> Using those kind of dotted expresion, you'll be able to build things
>>>>> such
>>>>> (not sure for the syntax)
>>>>>
>>>>> {yourlink.tag.begin}<img src="{yourimage.path}" title="{yourlink.label}"
>>>>> alt="{yourlink.label}" />{yourlink.tag.end}
>>>>>
>>>>> Luc
>>>>>
>>>>>
>>>>> Le 12/08/2010 11:38, Domi Garms a écrit :
>>>>>>
>>>>>> Hi Luc,
>>>>>>
>>>>>> thanks for your code snippet, now its working! But how can I do this
>>>>>> with a linked Image? Do I have to generate a renderlet:LINK, how is it
>>>>>> possible that the picture gets rendered? I tried it with a wrap on a
>>>>>> renderlet:IMAGE but it failed...
>>>>>>
>>>>>> Regards,
>>>>>> Domi
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2010/8/12 Luc Muller<l.mul-nospam-ler at ameos.com>:
>>>>>>>
>>>>>>> Well, I think it's kinda the way of doing.
>>>>>>>
>>>>>>> some things look strange to me... you're using a type="renderlet:BOX",
>>>>>>> you
>>>>>>> should user type="renderlet:LINK", not sure that url is going to work
>>>>>>> on
>>>>>>> renderlet:BOX.
>>>>>>>
>>>>>>> this is how i make my links in lister.
>>>>>>>
>>>>>>> <column name="readmore" type="renderlet:LINK">
>>>>>>> <label>LLL:readmore.label</label>
>>>>>>> <url>
>>>>>>> <userobj>
>>>>>>> <php><![CDATA[
>>>>>>>
>>>>>>> $aData = $this->oDataHandler->getListData();
>>>>>>> $typolink['parameter'] =
>>>>>>> $this->_oParent->conf['piconf.']['registerPageId'];
>>>>>>> $typolink['additionalParams'] =
>>>>>>> '&tx_myextension_pi2[param]= '.$aData['uid'].'';
>>>>>>> $typolink['useCacheHash'] = '1';
>>>>>>> $typolink['returnLast'] = 'url';
>>>>>>> return
>>>>>>> $this->_oParent->cObj->typolink('',$typolink);
>>>>>>>
>>>>>>> ]]></php>
>>>>>>> </userobj>
>>>>>>> </url>
>>>>>>> </column>
>>>>>>>
>>>>>>> using this in your template you can use {readmore.debug()} to see all
>>>>>>> the
>>>>>>> possibilities to display the link.
>>>>>>>
>>>>>>> Notes :
>>>>>>> - the label is, in this case constant it is issued from a locallang
>>>>>>> file
>>>>>>> it
>>>>>>> should be something like "read more..." but you can use either a
>>>>>>> userobj
>>>>>>> to
>>>>>>> fetch data from the current row
>>>>>>> - i prefer always using typolink function to build my links
>>>>>>> - typolink parameter is issued from a typoscript conf
>>>>>>>
>>>>>>> Luc
>>>>>>>
>>>>>>> Le 12/08/2010 10:27, Domi Garms a écrit :
>>>>>>>>
>>>>>>>> Hi Luc,
>>>>>>>>
>>>>>>>> Thanks for your reply. Im searching inside of my extension-tables, so
>>>>>>>> I tried for setting a link with params. The base-url is everytime in
>>>>>>>> front, is there a cleaner (and better) way for writing the link?
>>>>>>>>
>>>>>>>> http://www.testseite.de/test link
>>>>>>>>
>>>>>>>> Im sure that renderlet:BOX is wrong...but dont know which element
>>>>>>>> does
>>>>>>>> the
>>>>>>>> trick
>>>>>>>>
>>>>>>>> <column name="firstname"
>>>>>>>> type="renderlet:BOX" listHeader="Name">
>>>>>>>> <url>
>>>>>>>> <userobj>
>>>>>>>> <php><![CDATA[
>>>>>>>> $aRowData =
>>>>>>>> $this->oDataHandler->_getListData();
>>>>>>>> return
>>>>>>>> t3lib_div::locationHeaderUrl(
>>>>>>>>
>>>>>>>> $this->_oParent->pi_linkTP(
>>>>>>>>
>>>>>>>> $aRowData['firstname'],
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> array('tx_dmfaupairs[modus]'=>'1','tx_dmfaupairs[uid]'=>$aRowData['uid'])
>>>>>>>>
>>>>>>>> )
>>>>>>>> );
>>>>>>>>
>>>>>>>> ]]></php>
>>>>>>>> </userobj>
>>>>>>>> </html>
>>>>>>>> </column>
>>>>>>>>
>>>>>>>> Greetings
>>>>>>>>
>>>>>>>> Domi
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2010/8/12 Luc Muller<l.mul-nospam-ler at ameos.com>:
>>>>>>>>>
>>>>>>>>> I'm not sure to get the point.
>>>>>>>>>
>>>>>>>>> Let's take this exemple.
>>>>>>>>>
>>>>>>>>> You've made a formidable searchform and lister, to find some tt_news
>>>>>>>>>
>>>>>>>>> The lister, should build a link as shown there :
>>>>>>>>> http://formidable.typo3.ug/pastebin/snippet/61.html
>>>>>>>>> but pointing to the detail Page of your tt_news records.
>>>>>>>>> (maybe using typolink() instead of pi_getPageLink())
>>>>>>>>>
>>>>>>>>> label of your column renderlet:LINK can be the title of the tt_news.
>>>>>>>>>
>>>>>>>>> if you're searchform is searching inside records of a table that you
>>>>>>>>> handle
>>>>>>>>> fully with formidable. it works the same, but your "detail page"
>>>>>>>>> should
>>>>>>>>> contain a formidable plugin which displays the single item. this can
>>>>>>>>> be
>>>>>>>>> done
>>>>>>>>> using datahandler:DB and passing the UID of the item as third params
>>>>>>>>> in
>>>>>>>>> the
>>>>>>>>> 'init()' method of your plugin.
>>>>>>>>>
>>>>>>>>> Hope This Helps.
>>>>>>>>>
>>>>>>>>> Luc
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Le 12/08/2010 07:10, Domi Garms a écrit :
>>>>>>>>>>
>>>>>>>>>> Good morning,
>>>>>>>>>>
>>>>>>>>>> Im not sure how doing a searchform with a lister and link to the
>>>>>>>>>> item
>>>>>>>>>> for a single view. I looked into this two snippets:
>>>>>>>>>> http://formidable.typo3.ug/pastebin/snippet/65.html
>>>>>>>>>> http://formidable.typo3.ug/pastebin/snippet/61.html
>>>>>>>>>>
>>>>>>>>>> My first thought is, for building a link to a seperate site with a
>>>>>>>>>> param of the uid inside. Is there a cleaner way or a built in
>>>>>>>>>> function?
>>>>>>>>>> My second thought is to create typo3 pages and link to that one.
>>>>>>>>>>
>>>>>>>>>> What is the best way to deal with this, any hints are more than
>>>>>>>>>> welcome!!!
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> Domi
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> TYPO3-project-formidable mailing list
>>>>>>>>> TYPO3-project-formidable at lists.typo3.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable
>>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> TYPO3-project-formidable mailing list
>>>>>>> TYPO3-project-formidable at lists.typo3.org
>>>>>>>
>>>>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable
>>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> TYPO3-project-formidable mailing list
>>>>> TYPO3-project-formidable at lists.typo3.org
>>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable
>>>>>
>>>> _______________________________________________
>>>> TYPO3-project-formidable mailing list
>>>> TYPO3-project-formidable at lists.typo3.org
>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable
>>>>
>>
>> _______________________________________________
>> TYPO3-project-formidable mailing list
>> TYPO3-project-formidable at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable
>>
More information about the TYPO3-project-formidable
mailing list