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

How do I assign data to a database field from a drupal form

I submitted a similar question to this, but maybe didn't word it well.

I don't know how to create link from a form item to a database field. I can create the form, but where or how do I tell the form what database field should be updated once the form is submitted?

Thanks

Norm

User Blog Customization/Theming

I was just on the hunt for some thoughts on how best to provide user options (4.65+) to customize the appearance of their personal blog. This could be as simple as including a logo image (either in a block or somewhere else determined by template) or as complex as adding control over colors, fonts and included customized content blocks specific to that user blog. Or even something more similar to blogtheme.module.

How can I create tabs in my settings area

All I can say is that figuring out how to develop in drupal appears to be a pretty steep learning curve. I have spent hours trying to figure out how to create tabs in my settings screen, but can't seem to get it. I added my questions as comments to the code.

Here is what I have:
function poker_menu($may_cache) {
$items = array();
if ($may_cache) {
// This part works.
$items[] = array('path' => 'poker', 'title' => t('Poker Rankings'),
'callback' => 'poker_page',
'access' => user_access('access poker'));

// This part doesn't work and I have not figured out how to activiate it.
// What I want are tabs called list players. create league, create tournament
// and add player on my settings screen.
// I have a settings function written and it appears on the admin menu under settings and works,
// but the tabs don't get created.
$items[] = array('path' => 'create_league', 'title' => t('list players'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'add_league', 'title' => t('create league'),
'callback' => 'user_admin', 'access' => $admin_access,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'add_tourney', 'title' => t('create turnament'),
'callback' => 'user_admin', 'access' => $admin_access,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'add_player', 'title' => t('add player'),

empty form_select (or) form_checkboxes

I have been using Drupal CVS

and one of my users (they are testing it) pointed out that if he does not select any of the choices in the checkboxes It gives an Illegeal Choice.

I changed the checkboxes to form_select (after trying for 1 hr), still the same error exists.

Then I checked the forums and found that its a problem with 4.5 and 4.6

Has someone fixed this in CVS???

How to update a database field in settings menu

I tried searching, but the forum search is pretty weak. I need to update a field from what I am updating in the settings menu. The following is from the gallery module:

$form['gallery_drupal_dir'] = array(
'#type' => 'textfield',
'#title' => t('Location of Drupal'),
'#default_value' => variable_get('gallery_drupal_dir', '/'),
'#description' => t('Path to your drupal directory, relative to the root of your website. Please include a trailing slash ("/").'),
);

How to create a menu like the settings menu

I want to create a menu in the admin portion of a module I am working on that looks just like the menu for the settings page in version 4.7. The new page allows you to have the following for example:
General settings
Error handling
.....

When you click on one of the items, it exapnds the form open beneath it. How is this done? I have greped the code and can't find it. Can someone point me to the code I should be looking at to replicate this functionality?

Thanks

Norm

Pages

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