Custom destination 6.x-1.x-dev
File ID: 98138
Custom destination 6.x-1.x-dev Description
Description: Custom (Form) destination provides a way to define where a form should redirect the user upon submission.
When you submit a form, Drupal deals with your input (saving your node, sending an email, storing a setting, etc..) and then redirect you to a page. You usually are sent back to the page originating the request (for example when you enable a module) or to a different page (for example after you succesfully submit a new node, it will be displayed to you).
There may be some cases in which you want to override the default behaviour, that is you want to be redirected to a different page (see the Examples section below).
This is where Custom (Form) destination comes in handy, giving you the ability to define the page a form redirects to upon submission.
Ok. How do I use it?
To set a new destination page for a form you need 2 things (drumrolls): a destination page and a form.
A destination page is any valid Drupal path. Examples are "node/58", "mylandingpage", "admin/settings". Anything after ?q= or, if Clean URLs are enabled, anything after your Drupal root in the URL (e.g.: http://www.example.org/blog/2008/07 or, for sub-dir installations, http://www.example.org/sub/dir/drupal/blog/2008/07).
You will also need to identify the form finding out what we call a Form ID. It can be easily found by viewing the source of the page containing the form and navigating to find out the field with name "form_id". The value of the value= attribute of that field is the Form ID you are looking for.
If source code is not your thing you can install form inspect module, which will reveal the Form ID for you.
Once you have collected these two important info, you can navigate to Administer d-deDo Site configuration d-deDo Custom destination, click on the "Add custom destination" tab and input them in the corresponding field, hit the button and test that everything works!
Core contact.module redirects to "node/". You can use Custom destination to override this behaviour: using its simple interface define a new destination (any valid Drupal path) for the "Form ID" 'contact_mail_page' and you are all set!
Future possible improvements (feedback is welcome)
* print a notice on forms affected by the module current module configuration
* integration with Token module
Developer (mostly notes to myself)
* add some AHAH juice
* include tests
Development of this module has been kindly sponsored by John_Kenney.
Thanks to dipen Dojo wiki article from which I borrowed help text about Form ID.
Thanks to the core Path module from which I took a "great bit" of inspiration and code.
Related: destination, Module, drupal, Custom, Field, Define, override, behaviour, redirects, Interface, Configuration, Valid, Examples, Source, Redirect, Submit, Scripts, Dev, destination scripts, custom destination
O/S:BSD, Linux, Solaris, Mac OS X
File Size: 10.0 KB
|More Similar Code|
Custom (Form) destination provides a way to define where a form should redirect the user upon submission.
When you submit a form, Drupal deals with your input (saving your node, sending an email, storing a setting, etc..) and then redirect you to a page. You usually are sent back to the page originating the request (for example when you enable a module) or to a different page (for example after you succesfully submit a new node, it will...
The BrowserEmulator fopen functions is a class which offers you various features such as sending custom header lines, GET or POST requests, contains basic HTTP authentication and also the script is usable with all PHP file handling methods like...
The Custom Window Opener allows you to open new browser windows in the exact format you specify.
You can choose the width & position of the window, and also specify the windows location, menubar, resizable, scrollbars, status &...
This script is a custom scroll bar maker for both vertical or horizontal applications. The Scroll Bar may control a 'Scroll Element' content or return the slider position relative to its travel to a specified function.
This project will create a custom App Wizard for creating MEX files in Visual Studio.Net. After installing, use the wizard to create a skeleton mex-file project, with the correct project settings. Simply fill in your function code and compile to...
This package contains no M-code - just a set of custom icons I created for a blog post on Doug's Pick of the Week using the submitted icon editor.
This project will create a custom App Wizard for creating MEX-files in Visual Studio.Net. After installing, use the wizard to create a skeleton MEX-file project, with the correct project settings. Simply fill in your function code and compile to...
Simple display of the latest updates to your custom post type.
Simplicity at its finest!
This simple plugin adds a widget that allows for the display of recent posts in any custom post type. It functions almost identically to...
Works with Custom Smilies 2.3!
I use Custom Smilies 2.3 plugin. However, I prefer the Yahoo! Messenger emoticons. So, I did some digging, found them all, then tweaked my plugin to use those emoticons. Yahoo! Emoticons for Custom Smilies...
Use widgets or template tags to easily retrieve and control the display of any custom field values/meta data for posts or pages.
The power of custom fields gives this plugin the potential to be dozens of plugins all rolled into one.
|User Review for Custom destination