[TYPO3-formidable] templating searchform

Jérôme Schneider typo3dev at ameos.com
Thu May 20 21:55:01 CEST 2010


Hi Aike,

* Solution #1
*------------

Define a subpart named as your searchform in your template, where your 
searchform should be defined (it will be used and substituted in-place).
Note: searchform will find the html-subpart automatically only if rdt 
name and subpart name match.

Example:
--------
	XML:
	----

	<renderlet:SEARCHFORM name="mysearch">
		<datasource use="myds" />
		<childs>
			<renderlet:TEXT name="title" label="Title">
				<search onfields="title,header" />
			</renderlet:TEXT>

			<renderlet:SUBMIT name="btsub" label="Search" />
		</childs>
	</renderlet:SEARCHFORM>

	HTML:
	-----
	
	<!-- ###MAIN### begin-->
		
		<h2>Hello world</h2>

		<!-- ###mysearch### begin-->
			<p>
				{title.label.tag}<br />
				{title.input}
			</p>
			<p>{btsub}</p>
		<!-- ###mysearch### begin-->

		{mylist}

	<!-- ###MAIN### end-->


* Solution 2
*-----------

You may define the template subpart to use inside your xml:


Example:
--------
	XML:
	----

	<renderlet:SEARCHFORM name="mysearch">
		<datasource use="myds" />
		<template
			path="EXT:myext/pi1/html/template.html"
			subpart="###mysubpartname###"
		/>
		<childs>
			<renderlet:TEXT name="title" label="Title">
				<search onfields="title,header" />
			</renderlet:TEXT>

			<renderlet:SUBMIT name="btsub" label="Search" />
		</childs>
	</renderlet:SEARCHFORM>


I hope this helps,
Jerome Schneider

Le 20/05/10 21:34, Aike Terjung a écrit :
> Hi Michael,
>
> thank you for your example, but this is not my problem. Wat i am looking for is how to place the renderlets inside a Searchform with a template.
> I can put the searchform itself in a template, but i dont get the elements itsef into the template.
>
> thank you anyway
>
> Aike
> ----- Ursprüngliche Mail -----
> Von: "Michael Paffrath"<michael.paffrath at gmail.com>
> An: "TYPO3 project list for the FORMidable extension"<typo3-project-formidable at lists.typo3.org>
> Gesendet: Mittwoch, 19. Mai 2010 23:37:30 GMT +01:00 Amsterdam/Berlin/Bern/Rom/Stockholm/Wien
> Betreff: Re: [TYPO3-formidable] templating searchform
>
> Hi Aike,
>
> here is a little example.
>
> contact.xml:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <formidable version="0.7.76"
> xmlns:datahandler="http://www.ameos.com/formidable/080/datahandler"
> xmlns:datasource="http://www.ameos.com/formidable/080/datasource"
> xmlns:renderer="http://www.ameos.com/formidable/080/renderer"
> xmlns:renderlet="http://www.ameos.com/formidable/080/renderlet"
> xmlns:validator="http://www.ameos.com/formidable/080/validator"
> xmlns:actionlet="http://www.ameos.com/formidable/080/actionlet">
> <meta>
> <name>Contactform</name>
> <form formid="contactform"/>
> <displaylabels>true</displaylabels>
> <debug>false</debug>
> </meta>
> <control>
> <datahandler:VOID />
> <renderer:TEMPLATE>
> <template
> path="fileadmin/formidable/contact.html"
> subpart="###MAIN###"
> errortag="contacterror"
> />
> </renderer:TEMPLATE>
> <actionlets>
> <actionlet:USEROBJ>
> <userobj>
> <php><![CDATA[/*<?php*/
> // do something
> /*?>*/]]></php>
> </userobj>
> </actionlet:USEROBJ>
> <actionlet:REDIRECT>
> <pageid>63</pageid>
> </actionlet:REDIRECT>
> </actionlets>
> </control>
> <elements>
> <renderlet:TEXT name="firstname" label="First Name">
> <validators>
> <validator:STANDARD>
> <required message="First Name is required" />
> </validator:STANDARD>
> </validators>
> </renderlet:TEXT>
> <renderlet:TEXT name="lastname" label="Last Name">
> <validators>
> <validator:STANDARD>
> <required message="Last Name is required" />
> </validator:STANDARD>
> </validators>
> </renderlet:TEXT>
> <renderlet:TEXT name="email" label="Email">
> <validators>
> <validator:STANDARD>
> <required message="Email address is required"/>
> <email message="Email address not valid"/>
> </validator:STANDARD>
> </validators>
> </renderlet:TEXT>
> <renderlet:TEXTAREA name="message" label="Message">
> </renderlet:TEXTAREA>
> <renderlet:SUBMIT name="submit" label="Submit"/>
> </elements>
> </formidable>
>
> contact.html:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
> <title>Contact form</title>
> </head>
> <body>
> <!-- ###MAIN### begin-->
> <div class="form-container">
> <div class="form-firstname">{firstname}</div>
> <div class="form-lastname">{lastname}</div>
> <div class="form-email">{email}</div>
> <div class="form-message">{message}</div>
> <div class="form-submit">{submit}</div>
> </div>
> <!-- ###MAIN### end-->
> </body>
> </html>
>
>
> I hope that helps!
>
> Michael
>
> On Wed, May 19, 2010 at 11:23 PM, Aike Terjung<a.terjung at inmedias.com>wrote:
>
>> Hello,
>>
>> i am wondering how i could use a template for a SEARCHFROM? I could not
>> find a example, could someone help me?
>>
>> thank you in advance
>>
>> Aike
>>
>> --
>>
>> Telefon +49 2408 719983
>>
>> Internetagentur, Aachen, Hamburg:     http://www.team-in-medias.de
>> Typo3-Agentur, Aachen, Hamburg:      http://www.typo3-macher.de
>>
>> team in medias GmbH
>> Pascalstraße 15
>> 52076 Aachen
>>
>> Geschäftsführer: Dr. Erwin Lammenett
>> HRB 6764, Amtsgericht Aachen
>> _______________________________________________
>> 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