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

Alternate Post Option on Entry

Development and Programming

EyelightInc's avatar
EyelightInc
19 posts
14 years ago
EyelightInc's avatar EyelightInc

Hi, I’m working on a module for a client project and I’m wondering if the approach I’m considering is possible.

I’d like the client to be able to send email notices to those that have accessed an entry via a form in the control panel. Ideally this would show up on the entry publish screen in a separate tab. I’ve got the portion working that logs access.

Now I’m working out how to email those people. Is it possible to add a custom tab to the entry screen that includes a “send email button” instead of the standard submit button?

Or would I need to do this through a module control panel?

What other methods could I consider?

Thanks,

Anson

       
the3mus1can's avatar
the3mus1can
426 posts
14 years ago
the3mus1can's avatar the3mus1can

Take a look at this http://ellislab.com/expressionengine/user-guide/development/modules.html#tab_file.

       
EyelightInc's avatar
EyelightInc
19 posts
14 years ago
EyelightInc's avatar EyelightInc

Thanks the3mus1can I really appreciate the reply!

I have been referring to that document during development, but i’m still not clear if it’s possible to add an additional post button to a tab.

In this case the entry will already be saved and collecting access data for people that access it. When the admin updates the entry they want the ability to email all of those who have accessed it to notify them of the change.

So my thought was to add a new tab with a subject, message and send button.

I’ve already handled most of this programming, but I’m not sure if it’s possible to add a button to the new tab on the entry screen I create that calls a specific method instead of saving the entry.

Does this makes sense?

Thanks,

Anson

       
the3mus1can's avatar
the3mus1can
426 posts
14 years ago
the3mus1can's avatar the3mus1can

One of the options you pass back from the publish_tabs method is the field_type. You can create a custom field type and use it the tab.

       
EyelightInc's avatar
EyelightInc
19 posts
14 years ago
EyelightInc's avatar EyelightInc

Thanks the3mus1can,

I’ve made some progress but I haven’t gotten to the custom field type yet. Not sure if it’s necessary at this point.

I’ve got a basic tab added that posts a text and textarea field but when I add a radio button I’m getting an ‘invalid type message’ on post.

I had to guess on the format for the radio button type as I can’t find any reference in the docs or the forums.

Do you see anything below that would cause the ‘invalid type’ message or do you know of a reference on syntax for each field type?

$settings[] = array(
                    'field_id'             => 'send_notice',
                    'field_label'          => "Send notice?",
                    'field_required'       => 'n',
                    'field_data'           => 'No',
                    'field_list_items'     => array('Yes','No'),
                    'field_fmt'            => '',
                    'field_instructions'   => 'If you\'d like to send the message click yes before submitting.',
                    'field_show_fmt'       => 'n',
                    'field_pre_populate'   => 'n',
                    'field_text_direction' => 'ltr',
                    'field_type'           => 'radio'
                );

Thanks,

Anson

       
EyelightInc's avatar
EyelightInc
19 posts
14 years ago
EyelightInc's avatar EyelightInc

Finally got this working. I ended up using a checkbox instead of a radio button as a radio button returned invalid type each time. Here’s the code to create a checkbox field on a Publish tab. Below that I’ve pasted some attempts at creating radio buttons. I still wouldn’t mind learning the proper syntax.

$settings[] = array(
                    'field_id'             => 'send_notice',
                    'field_label'          => "Send notice?",
                    'field_required'       => 'n',
                    'field_data'           => '',
                    'field_list_items'     => array('Yes'),
                    'options'               => '',
                    'selected'               => '',
                    'field_fmt'            => '',
                    'field_instructions'   => 'Check the box to send the notice.',
                    'field_show_fmt'       => 'n',
                    'field_pre_populate'   => 'n',
                    'field_text_direction' => 'ltr',
                     'field_type'            => 'checkboxes',
                );
/* ATTEMPT AT CREATING RADIO BUTTONS (leads to red Invalid type message next to the field upon post 
$settings[] = array(
                    'field_id'             => 'send_notice',
                    'field_label'          => "Send notice?",
                    'field_required'       => 'n',
                    'field_data'           => '',
                    'field_list_items'     => array('Yes','No'),
                    'options'               => '',
                    'selected'               => '',
                    'field_fmt'            => '',
                    'field_instructions'   => 'Check the box to send the notice.',
                    'field_show_fmt'       => 'n',
                    'field_pre_populate'   => 'n',
                    'field_text_direction' => 'ltr',
                     'field_type'            => 'radio',
                );
                */
                
                
/* ATTEMPT TWO AT CREATING RADIO BUTTONS (leads to red Invalid type message next to the field upon post     
        $settings[] = array(
                    'field_id'             => 'send_notice',
                    'field_label'          => "Send notice?",
                    'field_required'       => 'n',
                    'field_data'           => 'No',
                    'field_list_items'     => array('Yes','No'),
                    'selected'                 => 'No',
                    'options'                => array('Yes','No'),
                    'field_fmt'            => '',
                    'field_instructions'   => 'If you\'d like to send the message click yes before submitting.',
                    'field_show_fmt'       => 'n',
                    'field_pre_populate'   => 'n',
                    'field_text_direction' => 'ltr',
                    'field_type'           => 'radio'
               );
*/

Now it would be nice to add something to the confirmation message. Anyone know how?

Cheers,

Anson

       

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.