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

Checkboxes

Development and Programming

Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

Try adding the a !== FALSE to the conditionals like so:

<?php if(strpos($stockist_offers, "Fabrics") !== FALSE): ?>
       
Mikee Bee's avatar
Mikee Bee
179 posts
17 years ago
Mikee Bee's avatar Mikee Bee

No joy :( would you mind if I PM you a login so you can have a quick peek?

Thanks Mark

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

that’d be great

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

Ok, somewhere we got all kinds of spelling errors throughout.

I changed everything to be stockist. Sometimes, I think I had mis-typed it as stocklist.

Anyways, it seems to be working

       
Mikee Bee's avatar
Mikee Bee
179 posts
17 years ago
Mikee Bee's avatar Mikee Bee

Great thanks Mark! I was planning to have pages where it only displayed results that have certain boxes checked. Kind of working like custom statuses. So if Furniture was checked the page would only display furniture and so forth. Is this possible?

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

Not without a good deal more PHP. You would have to add to your conditional something like:

&& $IN->SEGS[3] == 'FURNITURE'

That’s a really dry example and won’t work without including

global $IN;

in your template somewhere.

       
jonathanpoh's avatar
jonathanpoh
3 posts
17 years ago
jonathanpoh's avatar jonathanpoh

Has anybody used this extension for making custom “agree to terms and conditions” checkboxes that are required? Even when I make the field “required” in the custom weblog fields, the entry gets submitted anyway regardless if the T&C checkbox is checked or not

       
Adam Khan's avatar
Adam Khan
315 posts
17 years ago
Adam Khan's avatar Adam Khan

Anybody done this for categories? Would be much more pleasant than risking unclicking selected categories way offscreen.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

I for one, would like to see categories on the front page - either in their current form, or as checkboxes. They’re too important in some cases to be on a hidden tab. What about an extension for selecting default tab for a weblog or something?

UPDATE: Apparently Cocoaholic wrote an extension called “Tab Forward” that moves a certain tab to the front.

       
Adam George's avatar
Adam George
283 posts
17 years ago
Adam George's avatar Adam George

I’ve used this extension in place of categories. It has advantages and disadvantages:

Advantages: - Appears on front page, not hidden - More user-friendly (it appears as just another field, click a box, no risk of accidentally un-checking)

Disadvantages: - Layout becomes an issue when you have more than a few options, with words wrapping over lines. - Less accessible; There are no labels by default, only text next to the check-boxes (although it can be done). - Not as flexible as categories in it’s usage (although can be made more flexible with Mark’s ‘custom fields in exp:weblog tags’ extension).

       
Matt Harris's avatar
Matt Harris
95 posts
17 years ago
Matt Harris's avatar Matt Harris

Hi

im using this extension on my news weblog and its great!-thanks mark!

i had a question though, dont know if anyone has tried this:

i have 4 checkboxes (cat 1, cat 2, cat 3 and cat 4), and a news story can belong to more then 1 category. so a news story can belong to cat 1 and cat 3.

im trying to run a query on exp_weblog_data to find all stories that have cat 1. has anyone had any joy in trying to do this?

currently my SQL is: select * from exp_weblog_data where field_id_24 LIKE “cat 1”

any help would be useful

       
wtamplin's avatar
wtamplin
2 posts
17 years ago
wtamplin's avatar wtamplin

Hi. Is there a way to have the field output into a <li>{data}</li> list? Right now I have the loop start with a <li> and end with a </li>, while having the separator = </li><li>.

This seems sloppy. Is there a better way?

Sorry if this seems like a silly question, I’m new to EE.

       
juro's avatar
juro
118 posts
17 years ago
juro's avatar juro

Hi, I am using this extension but get a similar problem as with the multi-rel extension. This is my EE code:

{related_entries id="id_of_field"}
    <li>{title}</li>
{/related_entries}

and my output is

<li># title1</li> {REL[235][id_of_field]5D3G7cNqREL}

I am assuming that my use of related_entries is not correct. But how do I pull the checked items out of the entry?

edit:

Also, when echoing the checkbox values using {id_of_fields}, the correct ones pop up. But when I use the related_entry tag pair, already the first one is not correct - relating to my example on top the selected value would be “title0” but “title1” is displayed.

Any ideas?

EDIT I found out that Checkboxes DOES NOT save the rel_id but the actual entry_id. Although I find that better (the exp_relationships does not make sense to me), it does seem inconsistent to me!

       
juro's avatar
juro
118 posts
17 years ago
juro's avatar juro

Another thing. I have downloaded the version 1.0.2 but it still carries the version number 1.0.1 in the file. Also when the “separator” attribute does not change anything, so I am assuming that the version I am using is 1.0.1. Where can I get 1.0.2 from?

       
Ty Martin's avatar
Ty Martin
232 posts
17 years ago
Ty Martin's avatar Ty Martin

I’m getting the following all of a sudden (wasn’t doing so before).

MySQL ERROR:

Error Number: 1064

Description: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.group_id=w.field_group AND f.field_type='cbox'' at line 1

Query: SELECT f.field_id, f.field_name, f.field_pre_populate, f.field_pre_blog_id, f.field_pre_field_id FROM exp_weblog_fields AS f, exp_weblogs AS w WHERE w.weblog_id= AND f.group_id=w.field_group AND f.field_type='cbox'

Disabling the extension fixes it.

       
First 4 5 6 7 8

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.