[TYPO3-project-formidable] Multiple dropdowns

Michael Paffrath michael.paffrath at gmail.com
Mon Jan 18 17:31:17 CET 2010


Hi Jerome,

thanks for your answer.

I went away from the drop-downs and i´m using checkboxes now. But the
general problem stayed the same :(

This is my XML now:
<?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>RS lib</name>
		<form>
			<formid>rslib_search</formid>
		</form>
		<displaylabels>true</displaylabels>
		<debug>false</debug>
	</meta>

	<control>

		<datahandler:VOID />

		<datasources>
			<datasource:DB name="rslib">
				<sql><![CDATA[
					SELECT
						tx_mpeabis_rslib.uid,
						tx_mpeabis_rslib.title,
						tx_mpeabis_rslib.tstamp,
						tx_mpeabis_rslib.crdate,
						tx_mpeabis_rslib.summary,
						tx_mpeabis_rslib.bodytext,
						tx_mpeabis_tags.title as tagtitle,
						tx_mpeabis_output.title as outputtitle,
						tx_mpeabis_projects.title as projecttitle
					FROM
						tx_mpeabis_rslib,
						tx_mpeabis_projects,
						tx_mpeabis_tags,
						tx_mpeabis_output,
						tx_mpeabis_rslib_tags_mm,
						tx_mpeabis_rslib_output_mm,
						tx_mpeabis_rslib_project_mm
					WHERE
						tx_mpeabis_rslib.deleted = 0
						AND tx_mpeabis_rslib.hidden = 0
						
						/*AND tx_mpeabis_tags.uid = tx_mpeabis_rslib_tags_mm.uid_foreign
						AND tx_mpeabis_rslib.uid = tx_mpeabis_rslib_tags_mm.uid_local
						
						AND tx_mpeabis_output.uid = tx_mpeabis_rslib_output_mm.uid_foreign
						AND tx_mpeabis_rslib.uid = tx_mpeabis_rslib_output_mm.uid_local
						
						AND tx_mpeabis_projects.uid = tx_mpeabis_rslib_project_mm.uid_foreign
						AND tx_mpeabis_rslib.uid = tx_mpeabis_rslib_project_mm.uid_local*/
						
					GROUP BY tx_mpeabis_rslib.uid
				]]></sql>
			</datasource:DB>
		</datasources>
		
		<renderer:TEMPLATE>
			<template
				path="fileadmin/templates/formidable/rslib_search.html"
				subpart="###MAIN###"
			/>
		</renderer:TEMPLATE>
		
	</control>

	<elements>

		<renderlet:SEARCHFORM name="rslib_searchform">
			<datasource use="rslib" />
			<childs>
				<renderlet:TEXT name="title" label="Title">
					<search onfields="tx_mpeabis_rslib.title" />
				</renderlet:TEXT>
				<renderlet:TEXT name="author" label="Author">
					<search onfields="tx_mpeabis_rslib.author" />
				</renderlet:TEXT>
				<renderlet:TEXT name="freetext" label="Free text">
					<search onfields="tx_mpeabis_rslib.summary,tx_mpeabis_rslib.bodytext" />
				</renderlet:TEXT>
				<renderlet:CHECKBOX name="tags" label="Tags">
					<search onfields="tx_mpeabis_rslib.title,tx_mpeabis_rslib_tags_mm.uid_foreign"
/>
					<data>
						<userobj>
							<php><![CDATA[
								
								return $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows(
									"uid as value, title as caption",
									"tx_mpeabis_tags",
									"",
									"",
									""
								);

							]]></php>
						</userobj>
					</data>
				</renderlet:CHECKBOX>
				<renderlet:LISTBOX name="output" label="Output">
					<search onfields="tx_mpeabis_rslib_output_mm.uid_foreign" />
					<data>
						<items>
							<item caption="All" value="" />
						</items>
						<userobj>
							<php><![CDATA[
								
								return $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows(
									"uid as value, title as caption",
									"tx_mpeabis_output",
									"",
									"",
									""
								);

							]]></php>
						</userobj>
					</data>
				</renderlet:LISTBOX>
				
				<renderlet:LISTBOX name="projects" label="Projects">
					<search onfields="tx_mpeabis_projects.title,tx_mpeabis_rslib_project_mm.uid_foreign"
/>
					<data>
						<items>
							<item caption="All" value="" />
						</items>
						<userobj>
							<php><![CDATA[
								
								return $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows(
									"uid as value, title as caption",
									"tx_mpeabis_projects",
									"",
									"",
									""
								);

							]]></php>
						</userobj>
					</data>
				</renderlet:LISTBOX>
				<renderlet:SUBMIT name="rssubmit" label="Search" mode="search" />
				<renderlet:SUBMIT name="rsclear" label="Reset" mode="clear" />
			</childs>
		</renderlet:SEARCHFORM>
		
		<renderlet:LISTER name="list">
			<searchform use="rslib_searchform" />
			<pager>
				<rows>
					<perPage>10</perPage>
				</rows>
				<sort>
					<column>datetime</column>
					<direction>DESC</direction>
				</sort>
			</pager>
			<columns>
				<column name="title" type="renderlet:TEXT" listHeader="RS Library title" />
				<column name="author" type="renderlet:TEXT" listHeader="RS Library
author" />
				<column name="tagtitle" type="renderlet:TEXT" listHeader="RS Library tags">
					<recombine>
						<userobj>
							<php><![CDATA[/*<?*/
								$aRowData = $this->oDataHandler->_getListData();
								
								$res = $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows(
									"tx_mpeabis_tags.uid, tx_mpeabis_tags.title",
									"tx_mpeabis_tags, tx_mpeabis_rslib, tx_mpeabis_rslib_tags_mm",
									"tx_mpeabis_tags.uid = tx_mpeabis_rslib_tags_mm.uid_foreign
									AND tx_mpeabis_rslib.uid = tx_mpeabis_rslib_tags_mm.uid_local
									AND tx_mpeabis_rslib.uid = ".$aRowData['uid'],
									"",
									""
								);
								foreach($res as $re){
									$outp .= $re['title'].',<br/>';
								}
								$outp = substr($outp,0,-6);
								return $outp;
				  			/*?>*/]]></php>
			  			</userobj>
					</recombine>
				</column>
				<column name="projecttitle" type="renderlet:TEXT" listHeader="Project">
					<recombine>
						<userobj>
							<php><![CDATA[/*<?*/
								$aRowData = $this->oDataHandler->_getListData();
								
								$res = $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows(
									"tx_mpeabis_projects.uid, tx_mpeabis_projects.title",
									"tx_mpeabis_projects, tx_mpeabis_rslib, tx_mpeabis_rslib_project_mm",
									"tx_mpeabis_projects.uid = tx_mpeabis_rslib_project_mm.uid_foreign
									AND tx_mpeabis_rslib.uid = tx_mpeabis_rslib_project_mm.uid_local
									AND tx_mpeabis_rslib.uid = ".$aRowData['uid'],
									"",
									""
								);
								foreach($res as $re){
									$outp .= $re['title'].',<br/>';
								}
								$outp = substr($outp,0,-6);
								return $outp;
				  			/*?>*/]]></php>
			  			</userobj>
					</recombine>
				</column>
				<column name="outputtitle" type="renderlet:TEXT" listHeader="Output">
					<recombine>
						<userobj>
							<php><![CDATA[/*<?*/
								$aRowData = $this->oDataHandler->_getListData();
								
								$res = $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows(
									"tx_mpeabis_output.uid, tx_mpeabis_output.title",
									"tx_mpeabis_output, tx_mpeabis_rslib, tx_mpeabis_rslib_output_mm",
									"tx_mpeabis_output.uid = tx_mpeabis_rslib_output_mm.uid_foreign
									AND tx_mpeabis_rslib.uid = tx_mpeabis_rslib_output_mm.uid_local
									AND tx_mpeabis_rslib.uid = ".$aRowData['uid'],
									"",
									""
								);
								foreach($res as $re){
									$outp .= $re['title'].',<br/>';
								}
								$outp = substr($outp,0,-6);
								return $outp;
				  			/*?>*/]]></php>
			  			</userobj>
					</recombine>
				</column>
				<column name="crdate" type="renderlet:DATE" listHeader="Create date">
					<data>
						<datetime format="%d.%m.%Y" />
					</data>
				</column>
			</columns>
		</renderlet:LISTER>

	</elements>

</formidable>

What i´m trying to achive is an search form which breaks down
search-results, so i can filter which records have (e.g.) which tag(s)
AND which output types. (AND AND AND)

The problem is that it doesn´t really break down the search.
The search performed is no AND search but an OR search.

Can you point me to where i´m doing things wrong?

Sorry if these are (absolute) beginner faults, but thats what i am
regarding formidable :(

I hope i can be of more "use" for this group in the future ...

Regards,
Michael


More information about the TYPO3-project-formidable mailing list