[TYPO3-project-formidable] Multiple dropdowns
Michael Paffrath
michael.paffrath at gmail.com
Wed Jan 13 19:08:11 CET 2010
Hi everybody,
i´m new to Formidable and i already love it.
Right now i´m building a search form for an extension. Among other
data it is supposed to search for tags in a db.
It works fine if i use only one drop-down for the tags - as soon as i
try to use to drop-downs (which would give the user the chance to
narrow the search down) it doesn´t work anymore.
I´m not sure wether it is the mysql or something else i´m doing wrong.
Or if there is an even better way to do this in Formidable.
This is my xml - perhaps somebody can point me into the right direction:
<?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>Renderlet:LISTER, cached lists</name>
<form formid="newlisterpi1"/>
<displaylabels>true</displaylabels>
<debug>false</debug>
</meta>
<control>
<datahandler:VOID />
<renderer:STANDARD />
<datasources>
<datasource:DB name="rslib">
<sql><![CDATA[
SELECT
tx_myext_rslib.uid,
tx_myext_rslib.title,
tx_myext_rslib.tstamp,
tx_myext_rslib.crdate,
tx_myext_rslib.summary,
tx_myext_rslib.bodytext,
tx_myext_rslib.part1,
tx_myext_rslib.part2,
tx_myext_tags.title as tagtitle,
tx_myext_output.title as outputtitle,
tx_myext_projects.title as projecttitle
FROM
tx_myext_rslib,
tx_myext_projects,
tx_myext_tags,
tx_myext_output,
tx_myext_rslib_tags_mm,
tx_myext_rslib_output_mm,
tx_myext_rslib_project_mm
WHERE
tx_myext_rslib.deleted = 0
AND tx_myext_rslib.hidden = 0
AND tx_myext_tags.uid = tx_myext_rslib_tags_mm.uid_foreign
AND tx_myext_rslib.uid = tx_myext_rslib_tags_mm.uid_local
AND tx_myext_output.uid = tx_myext_rslib_output_mm.uid_foreign
AND tx_myext_rslib.uid = tx_myext_rslib_output_mm.uid_local
AND tx_myext_projects.uid = tx_myext_rslib_project_mm.uid_foreign
AND tx_myext_rslib.uid = tx_myext_rslib_project_mm.uid_local
GROUP BY tx_myext_rslib.uid
]]></sql>
</datasource:DB>
</datasources>
</control>
<elements>
<renderlet:SEARCHFORM name="search_rslib">
<datasource use="rslib" />
<childs>
<renderlet:TEXT label="Title">
<search onfields="tx_myext_rslib.title" />
</renderlet:TEXT>
<renderlet:TEXT label="Free text">
<search onfields="tx_myext_rslib.summary,tx_myext_rslib.bodytext,tx_myext_rslib.part1,tx_myext_rslib.part2"
/>
</renderlet:TEXT>
<renderlet:LISTBOX label="Tags">
<search onfields="tx_myext_rslib.title,tx_myext_rslib_tags_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_myext_tags",
"",
"",
""
);
]]></php>
</userobj>
</data>
</renderlet:LISTBOX>
<renderlet:LISTBOX label="Tags1">
<search onfields="tx_myext_rslib.title,tx_myext_rslib_tags_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_myext_tags",
"",
"",
""
);
]]></php>
</userobj>
</data>
</renderlet:LISTBOX>
<renderlet:LISTBOX label="Output">
<search onfields="tx_myext_output.title,tx_myext_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_myext_output",
"",
"",
""
);
]]></php>
</userobj>
</data>
</renderlet:LISTBOX>
<renderlet:LISTBOX label="Projects">
<search onfields="tx_myext_projects.title,tx_myext_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_myext_projects",
"",
"",
""
);
]]></php>
</userobj>
</data>
</renderlet:LISTBOX>
<renderlet:SUBMIT label="Search rslib" mode="search" />
</childs>
</renderlet:SEARCHFORM>
<renderlet:LISTER name="projectlist">
<searchform use="search_rslib" />
<columns>
<column name="title" type="renderlet:TEXT" listHeader="RS Library title" />
<column name="tagtitle" type="renderlet:TEXT" listHeader="RS
Library tags" />
<column name="projecttitle" type="renderlet:TEXT" listHeader="Project" />
<column name="outputtitle" type="renderlet:TEXT"
listHeader="Output media" />
<column name="crdate" type="renderlet:DATE" listHeader="Create date">
<data>
<datetime format="%d.%m.%Y" />
</data>
</column>
</columns>
</renderlet:LISTER>
</elements>
</formidable>
kind regards,
Michael
More information about the TYPO3-project-formidable
mailing list