5 of 6
5
Checkboxes
Posted: 21 June 2007 07:58 AM   [ Ignore ]   [ # 73 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

A couple of reasons, I had and error in my heredoc syntax (http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) and you need to make sure that the `EOT;` is the only thing on the line, meaning no spaces before it.

This should work:

<?php
    $stocklist_offers
= <<<EOT
    {stocklist-offers}
EOT;
?>

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 21 June 2007 08:11 AM   [ Ignore ]   [ # 74 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  318
Joined  03-07-2006

Hmm the syntax colouring in TextMate seems to be happier now and the page is appearing but no ‘checked’ fields are appearing??

 Signature 

· Confused… but happy ·

Profile
 
 
Posted: 21 June 2007 08:27 AM   [ Ignore ]   [ # 75 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

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

<?php if(strpos($stockist_offers, "Fabrics") !== FALSE): ?>

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 21 June 2007 08:31 AM   [ Ignore ]   [ # 76 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  318
Joined  03-07-2006

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

Thanks Mark

 Signature 

· Confused… but happy ·

Profile
 
 
Posted: 21 June 2007 08:33 AM   [ Ignore ]   [ # 77 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

that’d be great

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 21 June 2007 09:03 AM   [ Ignore ]   [ # 78 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

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

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 21 June 2007 09:43 AM   [ Ignore ]   [ # 79 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  318
Joined  03-07-2006

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?

 Signature 

· Confused… but happy ·

Profile
 
 
Posted: 21 June 2007 10:25 AM   [ Ignore ]   [ # 80 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

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.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 02 July 2007 06:23 PM   [ Ignore ]   [ # 81 ]  
Summer Student
Total Posts:  3
Joined  05-22-2007

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

Profile
 
 
Posted: 16 August 2007 09:34 AM   [ Ignore ]   [ # 82 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  962
Joined  12-20-2002

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

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 16 August 2007 09:56 AM   [ Ignore ]   [ # 83 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1726
Joined  03-26-2006

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.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 16 August 2007 05:07 PM   [ Ignore ]   [ # 84 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  596
Joined  12-10-2006

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).

Profile
 
 
Posted: 10 October 2007 03:53 AM   [ Ignore ]   [ # 85 ]  
Lab Assistant
RankRank
Total Posts:  113
Joined  08-18-2007

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

 Signature 

ExpressionEngine v 1.6.2

Profile
 
 
Posted: 04 February 2008 12:44 PM   [ Ignore ]   [ # 86 ]  
Summer Student
Total Posts:  2
Joined  01-05-2008

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.

Profile
 
 
Posted: 13 February 2008 03:55 PM   [ Ignore ]   [ # 87 ]  
Lab Assistant
RankRank
Total Posts:  156
Joined  10-25-2007

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!

Profile
 
 
Posted: 14 February 2008 07:26 AM   [ Ignore ]   [ # 88 ]  
Lab Assistant
RankRank
Total Posts:  156
Joined  10-25-2007

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?

Profile
 
 
Posted: 14 February 2008 06:46 PM   [ Ignore ]   [ # 89 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  486
Joined  07-12-2005

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.

 Signature 

Technology Consulting
Jobs, apartments, working and moving to Spain.

Profile
 
 
Posted: 08 March 2008 09:16 AM   [ Ignore ]   [ # 90 ]  
Grad Student
Rank
Total Posts:  52
Joined  03-05-2008

Hello!

I’m trying to use this extension to as a form of key for each of my weblogs. What I’d like to do is take the results and turn them into images, so for each entry in checkbox list, create an <img> tag.

Can anyone explain to me how I would do this?

Profile
 
 
   
5 of 6
5
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64905 Total Logged-in Users: 50
Total Topics: 81841 Total Anonymous Users: 32
Total Replies: 440033 Total Guests: 267
Total Posts: 521874    
Members ( View Memberlist )