Does anybody know of a checkbox group or multi-select that works with the query module?
I am currently using FieldFrame, but my results look like this:
a🔢{i:0;s:6:"Grant,";i:1;s:18:"Pro-bono services,";}
I want them to look like this: Grant, Pro-bono services
Alternatively, is there a way to strip the formatting stuff?
Thanks, Ben
What are you trying to do with the query module that FF_Matrix looping can’t do?
If your just trying to spit out the values (… say in a entries loop), you can do the following:
Custom Field: names
{names backspace="2"}
{first_name},
{/names}The above would output: Grant, Pro-bono services
Without the backspace of 2, you would get: Grant, Pro-bono services,
============== I actually built a checkbox and a multi-select extension that is compatible with ff_matrix that allows you to SELECT from “categories” within configured “category groups”. It’s quite convenient for assigning “matrix rows” to “categories”…. in fact it’s great for filtering entries by category within a matrix field/row.
No, it was giving me this: a🔢{i:0;s:6:“Grant,”;i:1;s:18:“Pro-bono services,”. Within a weblog tag pair it displayed as a bulleted list, but in the query module the formatting was not interpreted.
After trying all kinds of nested SQL functions to trim the formatting, I ended up switching the checkbox group to a text input since it was only used in the control panel.
Thanks for the response though.
What’s your query look like?
You can most likely accomplish what your looking to do even by embedding another template:
For example:
TEMPLATE 1:
{embed="site/template1" services="{names backspace="2"}{first_name}{/names}"}TEMPLATE 2:
{exp:query sql="SELECT * FROM table WHERE `column` LIKE '%{embed:services}%'"}… Using additional templates makes passing “looped” data to additional functions easier (bypassing the limitation of a single exp:weblog:entries limit by moving them to other templates)
If your trying to find each weblog entry where the title equals your checkbox value, you can modify the above to be something like:
(with “service_list” being the customfield shortname…)
TEMPLATE 1:
{service_list}
{embed="site/template2" service="{service_name}"}
{/service_list}TEMPLATE 2:
{exp:query sql="SELECT * FROM exp_weblog_titles WHERE `title` = '{embed:service}'"}
{entry_id}
{/exp:query}Basically, template 1 will loop the ff_matrix customfield named “service_list” and spit out the {service_name} column and pass it to template 2 where the query then checks for each “single” value.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.