We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Checkbox group that works with query module

Development and Programming

phobucket's avatar
phobucket
10 posts
16 years ago
phobucket's avatar phobucket

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

       
Jarrett Barnett's avatar
Jarrett Barnett
31 posts
16 years ago
Jarrett Barnett's avatar Jarrett Barnett

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.

       
phobucket's avatar
phobucket
10 posts
16 years ago
phobucket's avatar phobucket

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.

       
Jarrett Barnett's avatar
Jarrett Barnett
31 posts
16 years ago
Jarrett Barnett's avatar Jarrett Barnett

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)

       
Jarrett Barnett's avatar
Jarrett Barnett
31 posts
16 years ago
Jarrett Barnett's avatar Jarrett Barnett

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.

       
phobucket's avatar
phobucket
10 posts
16 years ago
phobucket's avatar phobucket

Thank you, Jarrett! That is a very cool and useful tip.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.