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

is there a hook function to set the header...?

Hello,

For some nodes in my module, I'd like to add some data in the headers, like additional META tags, or some extra css styles.

I can't find a hook_html_head() function that would allow me to do so?

Can you confirm it's impossible, or is there a way I missed?

thanks.

installing the patch taxonomy_browser

Hello ,

I am having difficulties installing the patch taxonomy_all.patch on top of drupal 4.6.1
with both normal and enhanced privileges.

The patch has been uploaded to the root of my drupal installation.

From this directory when i issue the shell command
# patch < taxonomy_all.patch
File to patch : database/database.mysql

i receive the error
... can't find file to patch at input line 28

Similar problems are found for other patches for database/updates.inc and modules/taxonomy.module

How do I do drop down menus?

I'm brand new to Drupal, after about 4 years of PostNuke.

One of the features that is super cool in Drupal, and one I would have written for my PostNuke sites if I were not making the switch is the drop down menus, and just to be sure we're on the same page, I mean the menu options you click on that then roll down more directly underneath.

I'm going through the docs now. I've been through modules developer guide, but maybe I missed how you make one module a 'sub-module' of another.

Can anyone point me in the right direction?

Thanks!
Skip

Flexinode: a field to manage a list

I wrote a flexinode field to easily manage a list of elements. You can choose to have an ordered or an unordered list; each element will have its own textfield.

Known issues: preview doesn't work (any idea?)

Here's the code, put it in

field_list.inc

in your flexinode directory.


<?php

function flexinode_field_list_name($field) {
return t('list');
}

function flexinode_field_list_form($field, &$node) {
$fieldname = 'flexinode_'. $field->field_id;

foreach ($node->$fieldname as $item) {
$item_fields .= form_textfield('', 'items][', $item, 60, 128);
}

$edit = $_POST['edit'];
if ($edit['items']) {
foreach ($edit['items'] as $item) {
$item_fields .= form_textfield('', 'items][', $item, 60, 128);
}
} else {
$item_fields .= form_textfield('', 'items][', '', 60, 128);
$item_fields .= form_textfield('', 'items][', '', 60, 128);
$item_fields .= form_textfield('', 'items][', '', 60, 128);
}
if($_POST['more']) {
$item_fields .= form_textfield('', 'items][', '', 60, 128);
$item_fields .= form_textfield('', 'items][', '', 60, 128);
$item_fields .= form_textfield('', 'items][', '', 60, 128);
}
$item_fields .= form_button(t('More fields'), 'more');

return form_group(t($field->label), $item_fields);
}

function flexinode_field_list_db_select($field) {
$fieldname = 'flexinode_'. $field->field_id;

Google SiteMap - which to choose?

Hello,

I'm very happy that Drupal is so quickly responding for new possibilities. The Google SiteMaps is very exciting possibility to increase number of visits.

But I can find to such modules on Drupal site.

1. Google Sitemap module by SamAMac
http://drupal.org/node/26133

Validating settings before they get saved

I need an extra password widget in a module, and have run into a snag.

I've implemented hook_settings. The behavior I want is to check if the password and the confirm password fields don't match, I want the usual sort of "Passwords Must Match" error message to appear.

The problem is that system.module saves my password settings very early in the request processing. I can't use hook_validate because it won't get called for the _settings page. I can't do the validation in hook_settings because the system steps in long before that.

What's the recommended way to deal with this. I have a solution that works, but it's so fragile that it's pretty much guaranteed to get broken the next time system.module changes:

if(isset($_POST['edit']['my_password'])){
//looks like we are setting the site password.
//make sure the copies match so we do not get locked out.
$pw = $_POST['edit']['my_password'];
$pw_confirm = $_POST['edit']['my_password_confirm'];
if($pw != $pw_confirm){
form_set_error('my_password', t('Passwords must match!'));
//and we must unset some globals to fool the systems settings
//gremlin. TO DO: This is hinkey, and may break.
unset($_POST['edit']['my_password']);
unset($_POST['edit']['my_password_confirm']);
if($_POST['op'] == t('Save configuration')){
$_POST['op'] .= "--mod"; //to fool system.module

Pages

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