1 of 6
1
Checkboxes
Posted: 03 October 2006 07:34 AM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

This extension is very similar to the “Multi Drop-down List” I created here http://expressionengine.com/forums/viewthread/38370/, however instead of a list it gives you checkboxes.  Let me know how this works for you all.

Update 1 Added the ability to use separator=”[string]” in a template tag to override the default separator

File Attachments
ext.checkbox_102.zip  (File Size: 4KB - Downloads: 1017)
 Signature 

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

Profile
 
 
Posted: 03 October 2006 08:47 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

Great!

Seems to work well.

I did notice that it stores the value of the checkbox, instead of a reference to it, like a Drop-down List does.
This makes updating the values nearly impossible. (you’d have to re-save all entries with the new values)

Thanks

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 03 October 2006 08:52 AM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

I’m not sure I understand.  This, in my opinion, works the same way as the Drop-down list.  Are you implying that the drop down list stores references?  Can you explain a little bit more?

 Signature 

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

Profile
 
 
Posted: 03 October 2006 08:59 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

Oops,

Have been staring at my screen a bit longer than I should wink

It does work the same as the Drop-down List! I was looking at the wrong data in exp_weblog_data.

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 03 October 2006 09:54 AM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Understood.  That exp_weblog_data table can get quite unmanageable.

 Signature 

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

Profile
 
 
Posted: 05 October 2006 08:56 AM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Update: i’ve added the ability to define a separator in a template tag now.

 Signature 

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

Profile
 
 
Posted: 11 October 2006 07:25 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
RankRank
Total Posts:  131
Joined  01-12-2006

Thanks for sharing this, it looks like exactly what I’m after. First impressions are that it works perfectly, but I did receive this error when I created a new checkbox-style custom field:

Notice: Undefined variable: field_type in /path/system/cp/cp.publish_ad.php on line 5402

 Signature 

VayaDesign | EE Design & Development Services
EE Goodies: TealTemplate, Simple Pagination Plugin

Profile
 
 
Posted: 11 October 2006 07:58 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Unfortunately, this is an inherent error in EE.  It comes in the Edit Field Group page where there is a switch statement that defines the variable $field_type.

switch ($row['field_type'])
{
    
case 'text' :  $field_type = $LANG->line('text_input');
        break;
    case
'textarea' :  $field_type = $LANG->line('textarea');
        break;
    case
'select' :  $field_type = $LANG->line('select_list');
        break;
    case
'date' :  $field_type = $LANG->line('date_field');
        break;
    case
'rel' :  $field_type = $LANG->line('relationship');
        break;
}

The problem with this is that below the switch they echo out $field_type, and if the field type is not in their switch then $field_type will not be defined.

If you would like to fix this problem I would recommend the following (and hopefully pMachine will follow suite).

Find the following line (around 5388):

switch ($row['field_type'])

before that place this line:

$field_type = "";

So that switch should look like this:

$field_type = "";
switch (
$row['field_type'])
{
    
case 'text' :  $field_type = $LANG->line('text_input');
        break;
    case
'textarea' :  $field_type = $LANG->line('textarea');
        break;
    case
'select' :  $field_type = $LANG->line('select_list');
        break;
    case
'date' :  $field_type = $LANG->line('date_field');
        break;
    case
'rel' :  $field_type = $LANG->line('relationship');
        break;
}

That should fix your PHP Notice.

 Signature 

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

Profile
 
 
Posted: 11 October 2006 08:23 AM   [ Ignore ]   [ # 8 ]  
Lab Assistant
RankRank
Total Posts:  131
Joined  01-12-2006

That works a charm. Thanks Mark.

 Signature 

VayaDesign | EE Design & Development Services
EE Goodies: TealTemplate, Simple Pagination Plugin

Profile
 
 
Posted: 12 October 2006 03:28 PM   [ Ignore ]   [ # 9 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1735
Joined  03-26-2006

Nice, looking forward to trying this as well as the multi-select extension. Thanks for your work.

 Signature 

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

Profile
 
 
Posted: 14 October 2006 11:04 AM   [ Ignore ]   [ # 10 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

If you’re using this extension in combination with any of my other extensions it is highly recommended that you update all of them or field data may not enter correctly.  You can find links to the individual posts below:

Checkbox: http://expressionengine.com/forums/viewthread/38843/
Multi Drop-down List: http://expressionengine.com/forums/viewthread/38370/
Multi Text: http://expressionengine.com/forums/viewthread/39153/
File: http://expressionengine.com/forums/viewthread/38997/

Or you can find a list of them on my docs page: http://docs.markhuot.com

 Signature 

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

Profile
 
 
Posted: 01 December 2006 02:36 AM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  574
Joined  08-31-2005

hey mark, is it possible to have the separator removed from the last item? Problem is, when out putting a list, you end up with something like this “Oranges, Apples, Watermellon,”. The last camma is not needed.

Profile
 
 
Posted: 01 December 2006 06:49 AM   [ Ignore ]   [ # 12 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Hum, it shouldn’t do that.  My guess is you have an extra blank space in your database.  I’ll look into why that may be there (or why the extension is outputting incorrect separators).  Thanks for the heads up!

 Signature 

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

Profile
 
 
Posted: 06 December 2006 04:14 PM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  05-14-2004

Hey Mark, really like the idea of your extension but I’ve got a couple of requests.

1) Being able to select {title} as the field we wish to pre-populate from.
and
2) is there a way to (for lack of a better word) separate the info back out when we parse it in the weblog entries tag?

Profile
 
 
Posted: 06 December 2006 04:51 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  574
Joined  08-31-2005

couldn’t you just save the output of the tag to a php variable, then explode the variable to a php array?

Profile
 
 
Posted: 08 December 2006 05:34 AM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  05-14-2004

Hey James.

I’d need to look into some php to do that. But it is a possiblity. If Mark can do request 1) I’m happy to take a bash at request 2) myself.

Profile
 
 
Posted: 11 December 2006 10:21 AM   [ Ignore ]   [ # 16 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

DavidJaymz, unfortunately selecting a ‘title’ field is out of my control.  This is the way the EE Drop-down list behaves by default, and since the checkbox extension piggybacks on that field it would take some considerable development time to implement this.  Also, if you’re looking for relating entries by title, try the Relationship field type or my Multi-Relationship field type.

is there a way to (for lack of a better word) separate the info back out when we parse it in the weblog entries tag?

how are you looking to separate this out?

 Signature 

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

Profile
 
 
Posted: 11 December 2006 10:29 AM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  05-14-2004

Cheers Mark for the reply mark.

I’m currently using the checkbox extension to select keywords from a keywords blog. Maybe thats making it too complex and I should just type the info in in your extension. There shouldn’t be that many keywords….

The reason I’d like to separate the data is to use it as a auto search terms. so ideally I’d like each “keyword” to be wrapped in a {keyword} tag.

Profile
 
 
Posted: 11 December 2006 11:32 AM   [ Ignore ]   [ # 18 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Hum.  I see your problem.  It may be possible to get the titles into there, however as a quicker fix I would just include another field in the keyword weblog and make it required, then just enter your tag into the title and the custom field.  Then, assuming they are the same value you can use the auto search.

 Signature 

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

Profile
 
 
   
1 of 6
1
 
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: 65030 Total Logged-in Users: 21
Total Topics: 82119 Total Anonymous Users: 21
Total Replies: 441326 Total Guests: 171
Total Posts: 523445    
Members ( View Memberlist )
Newest Members:  cfvicdreamNOIRgmonCooperWrightReedsmeenoiYang.JianuoioitsukiNathan Hammondalexcig