The articles on this page are ComputerMinds' contribution to the Planet Drupal aggregated article feed. Planet Drupal is intended to collate interesting and useful Drupal content from around the web.
A quick one that came up today, we all know about the login redirect module, which automatically redirects the user to a specific page when they login ... but what about at logout? Its a common scenario, you want to display a nice 'come back soon' message when one of your lovely users does the unthinkable and logs out. One solution would be to create a new module, implement hook_user and then invoke a drupal_goto...
By default the Drupal event module will provide a nice calander block, listing the days of the week accross the top using 3 letter abbreviations (mon, tue etc). This little theme snippet will override this default behaviour and display the first letter of each day of the week (i.e. M T W) etc. Pop the following into your template.php file and you should be in business function phptemplate_event_calendar_month($op, $header, $rows, $attributes = array(), $caption =...
TinyMCE has a habit of popping up right where you don't want it - the log field on a node edit page is a good example. Lucklily it is a relatively easy job to theme out tinymce for a particular textarea. The following theme override should go into your template.php file function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) { switch($textarea_name){ case 'nodewords-description': case 'edit-nodewords-description': unset($init); return $init; break; default: return theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running); } } Just...
We have had a few sites recently on which TinyMCE was playing up on narrow themes. The buttons where not breaking onto new lines, causing the TinyMCE textarea to be much too wide. We solved the problem with the following snippet of CSS .mceToolbarTop * { float:left; } .mceToolbarTop select { width:auto!important; } .mceToolbarTop option { float:none; }
Adding new custom regions (areas into which you can place blocks) to a Drupal template is dead easy ... Simply add the following to your template.php file : function YOUR_THEME_NAME_regions() { return array( 'content_top' => t('content top'), 'content_bottom' => t('content bottom'), 'left' => t('left sidebar'), 'right' => t('right sidebar'), 'content' => t('content'), 'header' => t('header'), 'footer' => t('footer'), 'new_region1'=>t('A new region') ); } Make sure you change the YOUR_THEME_NAME bit to match the name of...
Drupal 5.2 was released last night, containing a couple of quite importants ecurity patches and some other minor bug fixes. http://drupal.org/drupal-5.2 We will be upgrading our client's sites over the next couple of days
Just a quick one this - you will probably find that when you use Tinymce and the standard Filtered HTML input format, all your text bunches up and doesn't break correctly. Once solution to this is to use Full HTML - fine for the admin user but not so good for your average member of the great unwashed. So, the solution is to goto admin/settings/filters and configure the "filtered HTML" filter. You then want to...
There is nothing worse than having your browsing flow interrupted by a login screen that does not return you to your origional destination. Drupal manages to get around this problem by allowing you to append a "destination=XXX" query string parameter to the 'user' login URL. This is excellent and works well, except what happens if the user clicks the register tab while on the login screen - the destination query string is lost and the...
Putting together an upload form in Drupal 5 is easier than you think - there are just a couple of things you need to remember ... The form is built like this: function build_upload_form(){ $form['#attributes'] = array('enctype' => "multipart/form-data"); $form['file_upload']=array('#type'=>'file','#title'=>'Filename'); $form['submit']=array('#type'=>'submit','#value'=>'Upload file'); return $form; } And the submit is handled like so, note - the value passed into file_check_upload is the name (terminal array key) of the form element defined in your form building function...
It is perfectly possibly to work with Drupal using the free tools that come with Windows, nothing more than notepad and Internet Explorer - but just because its possible doesn't mean its a good idea! We work with Drupal all day everyday - and rely on a small arsenal of applications to stop us going insane! 1. Firefox - (http://www.mozilla.com/en-US/firefox/ ) Everybody has heard of firefox right? The browser that has MS running scared (and...