This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Default value in form_file

Hi,

I'm starting to develope a module (newbie in PHP and Drupal) and maybe my problem is not so hard.
In one form of my module I want to give upload functionalities (images & other files).
It is possible to load the default value (the value originally stored in the database) in a form_file?

Thanks

Marcello

Is drupal supports only paypal and authorize.net?

Is drupal supports only paypal and authorize.net? Can any one suggest how to intigrate ccavenue payment gatway to drupal. I already signup with CCavenue and provided a from submission code ("Variable Amount Interface " ).

When user select payment method as credit card the form should be submitted through ccavenue form submission code.

Kindly provide some help regarding this.

Any help can be appreciated : )

Taxonomy_menu change

Hello, I would like to change some of taxonomy_menu node view in main page(center) on center page. I would like to change simple "tilte" to "tabs" style. If I click on some hierarchcal taxonomy node I would like to see tabs on main (center) page. Could You help me?

search results - html tags visible

Hi there,

Have just done some investigations as to why some search results are getting returned with html content visible. Have put in a few lines of code in search.module as a quick fix -

if ($item['type'] == 'classified' || $item['type'] == 'wikipage' || $item['type'] == 'news') {
  $item['snippet'] = strip_tags(html_entity_decode($item['snippet']),'<strong>');
}

Doesn't completely solve the problem though, because sometimes the snippet includes half a tag, which is still visible.

Best way to include css in a module?

I'd like to ask people's opinions on the best way to include css into a module. An example might be event.module which includes is own css file using:

$output .= theme('stylesheet_import', drupal_get_path('module', 'event') .'/event.css','screen');

This is a good way to include the css, but if a user wants to change parts of it for their own theme they either have to include the changes in their style.css file or change the module version of the css file. The latter is not ideal as later on in an upgrade you would need to merge the new (module defined) css file and your css changes, and it is not theme specific.

One method that I have used is to include the module css file as above, but also look in the theme dir for a css file and if it is there also include it (after the module version). So the code looks like:

global $theme;
if ($theme === NULL) {
    $theme = init_theme();
}
$output .= theme('stylesheet_import', drupal_get_path('module', 'gallery') .' drupal_g2.css','screen') ."\n";
$themecss = path_to_theme() .'/drupal_g2.css';
if (file_exists($themecss)) 
          $output .= theme('stylesheet_import', $themecss,'screen') . "\n";
}

There is a kludge here in that sometimes the $theme variable is not initialised yet and so path_to_theme() returns nothing, so I have to call init_theme().

New Module: Append_Here - for shortcutting directly from 'view page' to 'add child'

Note: This is only relevant to 'heirachical' site structures based on menu.module.

It's sort of an extension to menu-On-The-Fly.

Thinking like a user, I found the whole 'create content' route a bit cumbersome, especially when the 'navigation menu' was getting large and I had to use it only after creating a node.

I'd appreciate any feedback on if there are better ways to do things in this code - over-riding the form 'action' in the nodeapi feels like a bit of a hack ... but it works well!

.dan.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions