[TYPO3-english] wfqbe and rawquery and preProcessQueryStructure
Cathy Stephens
cathys8780 at gmail.com
Tue Aug 17 23:06:01 CEST 2010
Hi Mauro
I have tried your suggestion but something is wrong. No matter how I
try to change the typoscript (and I have tried several variations), it
does not seem to do anything to the query.
My custom select statement (record #17) is:
WHERE Station = '###WFQBE_STATION###' ###WFQBE_DAY###
Then built a search record (#27) from the select record (#17). Used
both markers above. Set to select fields and pulled dynamically. So
have two fields - Station (WFQBE_STATION) and Day (WFQBE_DAY).
The Typoscript on the page where the query is inserted:
[globalVar = GP:tx_wfqbe_pi1|DAY != ]
plugin.tx_wfqbe_pi1.customQuery.27 {
DAY = TEXT
DAY.data = ###WFQBE_DAY###
DAY.stdWrap.wrap = AND Day='|'
}
Where 27 is the id of the query record. And what I see in the debug is this:
...WHERE Station = 'College' Thursday
The marker is being picked up but it is not being wrapped. Same
behavior without that additional typoscript. If the first field is
selected (Station) and I leave Day blank, then I get results filtered
by Station. But does not work when you add a day. I even tried
setting the global to DAY = Thursday. Then modified the typoscript so
value would be "and day='Thursday'" but this had no effect either
when Thursday was selected in form.
I see what you are trying for and would be great if it worked but I am
missing something I think.
Thank you,
Cathy Stephens
This hook is useful in QBE queries only, not in raw queries, sorry :-(
> If so, any thoughts how to work around this so I can get the empty
> query fields stripped out?
>
You can work via typoscript / PHP:
SELECT * FROM table WHERE field1='###WFQBE_field1###' AND
field2='###WFQBE_field2###'
can be modified as follows:
SELECT * FROM table WHERE field1='###WFQBE_field1###' ###WFQBE_field2###
and via typoscript you can do something like this:
[globalVar = GP:tx_wfqbe_pi1|field2 != ]
plugin.tx_wfqbe_pi1.customQuery.123 {
field2 = TEXT
field2.data = ###WFQBE_field2###
field2.stdWrap.wrap = AND field2='|'
}
[end]
Not tested but it should work. In any case this is just an idea on how
to customize you raw queries.
I hope this will help you.
Regards,
--
Mauro Lorenzutti
--
Cathy Stephens
More information about the TYPO3-english
mailing list