Drupal: not yet solved

Created by janroe

The following have evaded me despite quite some searches. I don't quite understand how the Drupal system can make a lot of things so easy, while other seemingly innocent things can get you quite stuck. It does not follow the logic demanded by its own system.

This is for further update. Solved issues go into the menu items below this menu item.

Topics: - Image uploading, attaching from web, referencing on the site or attaching exisisting image from the site - in short, image or management. - Changing the heading of the Drupal D6 Contact page - Changing the content of Ubercart for Drupal D6 customer emails.

 

Image or media management

This is specifically for Drupal 7 - D7 some of it may apply to Drupal 6.

There are two major "forward looking" ways to upload images to content - mentioned here in user's terms.

One - make a cck image field. Give it a Label (ie. "Image" or Images", choose a field type "Image" and a widget "Image". You can upload one or more images, depending on how you configure the image section. This goes for D6 and D7. For D6 this requires the CCK module "file field". For D7 CCK is included in core and this module is not needed. Even CCK is not mentioned anymore, the functionality is simply included as "additional fields". There also are a few enhancement modules.

Two - make a cck image field, Give it a Label ie. "Image" or Images" or "Media", choose a field type "Image" and a widget "Media selector". This is availeble in D7 only and makes all sorts of media possible. It also includes a file browser of all media on the site. So this is also a complete image/media management system. Super. It requires the D7 Media module and there are also some (temporary or not) enhancement modules.

In D6 the first and only option worked well for me. This is for D7.

Two issues. File uploading works fine, but as soon as we want to use existing files, it becomes complicated.

1. With option one, in order to put existing files into the post we need another module, "filefield sources" and file browser IMCE. The IMCE file broser can also appear under a tab in the user's profile.

Problem: [SOLVED] After configuration, this file browser appears and works fine in the user profile, but the file browser refuses to appear in the image image upload/attach/reference area. No way to use an existing image if the file browser isn't even there. Spent quite some hours on it, tested with a completely different distribution where this works (but that distribution is faulty in other ways). In my own "clean" setup the file browser simply does not appear in the create/edit content's image upload/attach area.

Others have had this issue too, and another module "IMCE fo file field" should address this issue, but it isn't working for me. All versions latest as of 22 Sept. 2012. http://drupal.org/node/1143924 #2 while no amount of fiddling helps

Things that are easily misconfigured:

- for file locations, IMCE appears to suggest a file path under . Here it refers to not the site but defines its as the path already set in Configuration > File system > file system path! This is easily misunderstood. This one I quickly found when even the file browser under the User profile's tab was not working (it had actually created the sites/default/files/images path leading me to believe that it was the correct location - while all the while these directories were in fact created within the sites/default/files path set in the File system.

- to actually add the file browser to the upload/reference/attach options, you need to separately check mark IMCE as an option. This is in the collapsed File sources group! It's easily missed.

2. With option two, we have upload, web and internal site sources working fine. It's internal file/media browser is great.

Problem: [SOLVED FOR V 7.2 in development] The alt and title tags are not supported. All images /media appear without these tags. A major usability and sef issue - this may be solved in the 7.2 version of "Media", and i understand it is being worked on right now. In the meantime I can't get option 1 solved. http://drupal.org/node/1307054

Stuck between a rock and a hard place.

Any tip to make the IMCE file browser appear in the image file field /file field sources section is highly appreciated !!!

PS: It does make the good old "Imagepicker" look like the ideal solution (and it still works fine on some of my older D6 web sites.)

 

Changing the heading of the Drupal D6 Contact page

This issue has received a workaround: abandoned the contact page module for the webform module.

That H1 heading "Contact" won't budge. Since I use it for a contact form only, that's what it should say: "Contact form".

Tried the following three alternatives in acquia_prosper/template.php:

hook_form_FORM_ID_alter /** * Implementation of hook_form_FORM_ID_alter() - change page heading "Contact" to "Contact form" * from bottom of http://drupal.org/node/853266 - but DOES NOT WORK */ function acquia_prosper_form_contact_mail_page_alter(&$form, &$form_state) { drupal_set_title('Contact form'); }

Preprocess /** http://drupal.org/node/467660 - DOES NOT WORK */ function acquia_prosper_preprocess_page(&$vars, $hook) { global $theme; // If contact module is enabled, set title of page to 'Contact us' if (module_exists('contact')) { if (arg(0) == 'contact') { $vars['title'] = t('Contact form'); } } }

jQuery /** http://drupal.org/node/467660 but ALSO DOES NOT WORK * SYNTAX ERROR unexpected '=' in first line */ Drupal.behaviors.acquia_prosper = function (context) { if (jQuery().replaceWith) { //change the title on the sidewide contact form @ /contact $('.page-contact .content-main h1', context).replaceWith('

Contact form

'); } } Maybe here the css reference is wrong for the acquia_prosper theme, but the script already stops at the "=" sign.

These do not work on two acquia_prosper sites, one using i18n and and the tcontact module, the other plain English only.

One thing that does work, but not in my needed multi language, is css. It is also easy to do. Add this to acquia_prosper/css/local.css. Note that in Aquia Prosper the local css file is specifically designed to hold css styling customisations:

/* Contact page H1 heading: change /---------------------------------------------------------- */ /* works - but not for multilanguage */ body#pid-contact.not-front h1:after, body#pid-contact.not-front h1.title:after{ content: " form"; } If you want to use this for any theme other than Aquia Prosper, you need to identify the proper css references that your theme uses, best with Firebug.

Again, this works but makes no sense for multi language because the word "form" is appended in all languages. For one single language it's fine. You can also put something in front by using "before". This might not be overly good for SEO purposes, but the contact form is one that is best "nofollow" anyway.

 

Changing the order confirmation email

And for that matter changing any other emails Ubercart sends to customers.

This appears to be principally not possible in the admin user interface. Changing the customer emails can't be done there and it won't get fixed in D6. From what I understand, you must go into the file system, make changes there and add code. This is not at all the Drupal way, where you can, for example modify all email texts (even on multilingual basis) for the various types of user registration methods. Quite unbelievably, Ubercart hard codes things in D6.

This is how Ubercart deals with the simple question of changing the customer confirmation email, and there are many exampled like it: http://www.ubercart.org/forum/support/9562/customizing_order_confirmation_email

Ok, comment #24 points into the right direction. Really I just want to make the tiniest change. I'll savour this later.

 

Wishlist

Looking for a module to add a wish list, so that someone can make a wish, and someone else can buy it for them. But the list needs to be restricted to items on the same site.

http://drupal.org/project/wishlist Has a nice, real-life demo. The wish items can be described (body text) on the site, or can be links to items anywhere on the web.

http://drupal.org/project/uc_wishlist Not overly popular, not well maintained, appears to have unfixed bugs (42 of 49 issue are open). No word on D7.