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

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.

Google API Search module

Hi,
I just finished developing a Google API module. It could be seen in action here: http://news.healthelp.org . I am waiting to post the module to the Drupal CVS, if aproved, but in the mean time you could find it here: http://www.solutionsdepot.com.

Please send me any sugestions you may have related this module.

Thanks

ecommerce cart module problem

following error appear, when i "continue to payment details"

Fatal error: Call to undefined function: store_transaction_validate_overview() in /home/www/web162/html/modules/ecommerce/cart/cart.module on line 272

and this when i try to "create transaction"

Fatal error: Call to undefined function: store_transaction_overview_form() in /home/www/web162/html/modules/ecommerce/store/store.module on line 729

Please Help, Im a newB
Thnx

Pages

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