Radio Button
Posted: 22 October 2006 09:55 AM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  2006-01-05

This extension adds a new custom field type for radio buttons.  Just install the extension and you can add radio fields the same way you would add drop down lists.

File Attachments
ext.radio_102.zip  (File Size: 3KB - Downloads: 396)
 Signature 

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

Profile
 
 
Posted: 10 May 2007 03:15 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  288
Joined  2002-08-07

hey mark,

maybe i’m missing something, but after i enabled this plugin and select it in a new custom field, i don’t see any visible “select option”. i assume it is supposed to look similar to the drop-down list? thanks. i’ve attached a grab of what i’m seeing in the cp.

-rws

Image Attachments
Picture 57.png
Click thumbnail to see full-size image
Profile
 
 
Posted: 11 May 2007 10:20 AM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  2006-01-05

Try the new version (1.0.2) and see if that fixes this.

 Signature 

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

Profile
 
 
Posted: 12 May 2007 01:08 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  288
Joined  2002-08-07

worked like a charm, thanks mark.

Profile
 
 
Posted: 17 May 2007 09:32 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  288
Joined  2002-08-07

hey mark,

this is kind of a little thing, but is it possible to have one of the radio buttons selected as default. perhaps as simple as the first one listed? thanks again for another very useful extension.

-rws

Profile
 
 
Posted: 17 May 2007 10:01 AM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  2006-01-05

I’ll look into adding this functionality.  I am little hesitant because unless I can build a preference to turn off the preselection I’m sure some people would not apprecieate this.

Anyways, if you’d like to alter the file yourself, just find the following lines and make the necesary changes:

// -- Find This
$select = ($item == $field_data) ? true : false;
// -- Change to This
$select = ($item == $field_data || ($field_data == '' && $key==0)) ? true : false;

// -- Find This
$select = ($entry["entry_id"] == $field_data) ? true : false;
// -- Change to This
$select = ($entry["entry_id"] == $field_data || ($field_data == '' && $key==0)) ? true : false;

That’s off the top of my head though, so let me know if this works.

 Signature 

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

Profile
 
 
Posted: 17 May 2007 10:08 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  288
Joined  2002-08-07

bingo, works as advertised.

Profile
 
 
Posted: 06 July 2007 02:49 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1266
Joined  2007-01-05

I just spotted a bug.

If you choose to make a custom field a radio button before you choose none as the formatting option it adds tags automatically.

 Signature 

Steven Hambleton | Cairns Web Design

Profile
 
 
Posted: 16 July 2007 12:19 AM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1266
Joined  2007-01-05

It’s still adding paragraph tags automatically so this is my EE code -

{if matting_lip == "Yes" OR matting_lip == "No"}<li>Lip?: {matting_lip}</li>{/if}
{if matting_type
== "Smooth" OR matting_type == "Spiked"}<li>Type: {matting_type}</li>{/if}

and I get this -

<li>Lip?: <p>Yes</p></li>
<
li>Type: <p>Spiked</p></li>

I’m not a PHP wizard so I wouldn’t know how to edit any of this.

Over to you Mark!!

PS. I’m using the latest version of Radio Ext and Version 1.6 Build 20070627 of EE.

 Signature 

Steven Hambleton | Cairns Web Design

Profile
 
 
Posted: 16 July 2007 02:17 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  754
Joined  2002-03-16

If I’m correct, there is a plugin Mark has written that strips the <p> tags ... its called strip_p or so. That or any other plugin removing html code might work as a workaround?

-Markus

 Signature 

Markus Stolpmann • Expression Engine 1.6.4
Current project: kamaco.info - (german) website for Austrian publication coach K. Matejcek

Profile
 
 
   
 
 
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 10:33 AM
Total Registered Members: 59014 Total Logged-in Users: 22
Total Topics: 69971 Total Anonymous Users: 12
Total Replies: 376984 Total Guests: 527
Total Posts: 446955    
Members ( View Memberlist )
Newest Members:  abahkinezoAdnan RajabrasstunerjishiHa.ahn.Mnmakoto kuwatawstuckey81unexpectedlyBelle