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.
This was written in response to a post on drupal.org regarding query strings in drupal menu items. Currently if you create a drupal menu item linking to an external site with a querystring then this will render correctly. However if you try and use a relative URL (i.e. an internal link) then your querystring will be escaped and the URL won't work. This override lives in your template.php file and parses all your menu paths...
This small theme override will allow you to select which Drupal textareas the image assist icon will appear on /** * Theme for adding an image link underneath textareas */ function phptemplate_img_assist_textarea_link($element, $link) { if ($element['#id']=='edit-body'){ return theme_img_assist_textarea_link($element, $link); } } The above code will limit the icon to appearing on only the node edit body fields, you can add more ids as required
Just a quick one this, and not strictly Drupal related - but might save you some time when you are writing modrewrite rules to rewrite legacy URLs. The problem : We had a whole bunch of legacy URLs in the format index.php?Page=SomePageHere which we needed to rewrite to point at some shiny new Drupal URLs. A simple RewriteRule wasn't working, and after a bit of digging we discovered you can't reference the querystring within a...
You have to be a little careful with this one, but there are many times when in would be very handy to have HTML in your Drupal menu items. For example, you might want your Drupal menu to have a
to force a break, or perhaps insert a around some content to get a two-tone menu item Add the following to your Drupal theme's template.php file function phptemplate_menu_item_link($item, $link_item) { $output = l($item['title']...
The Drupal search block form is one of those things that gets used in most themes, and frequently needs a bit of themeing to bring it in line with your target design. The following snippet (which needs to live in your template.php file) will change the word "Search" in the submit button to "Go", and will add a title to the search terms box ... function phptemplate_search_block_form($form) { $form['search_block_form_keys']['#title']='search the site'; $form['search_block_form_keys']['#size']=10; $form['submit']['#value']='GO!'; return drupal_render($form)...
The contact page exposed by the Drupal contact module is great, it allows you to put together a contact form quickly and easily. But there is one small(ish) problem, the header text for the form is being filtered - which prevents you from using certain tags (for example embed). We found this problem when trying to embed a youtube movie onto the drupal contact form. The solution is a little bit of themeing - put...
One of the classic Drupal problems that catches a lot of newbies out is the memory error exhausted error. Typically you get this on the modules page - but it could appear almost anywhere. Its nothing much to worry about and can be easily solved by following the advice posted here http://drupal.org/node/76156
Its always the way, you go months without dealing with flash in Drupal when all of a sudden you get 5 people all asking the same thing, how do you deal with flash in Drupal. We use the swftools module (http://drupal.org/project/swftools), these excellent modules give you an easy way to embed flash objects in your Drupal site. We will cover the basics of adding flash content to your Drupal site below. Download swftools from drupal.org...
You may have spotted that for some Drupal themes in some versions of Firefox the titles on fieldsets are sometimes not there ... This little CSS snippet should solve the problem ... fieldset legend {display:block; }
There are times when it's necessary to add some additional markup to a particular menu item, for example a link to DrupalMinds might need a strong tag around the Drupal portion. This can be achieved in a couple of ways, both using a very similar theme override. Option 1 The first method is to allow HTML in the title of all menu items - while this is nice and easy, it does mean that you...