Central NJ Drupal meetup Wed, March 2, 7 pm

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by pwolanin on February 15, 2011 at 12:54am
Start:
2011年03月02日 19:00 - 21:00 America/New_York
Organizers:
Event type:
User group meeting

Location: Institute for Advanced Study, Bloomberg Hall, Room 201 (Physics Library)

Topics:

  • Discussion of Drupal books and documentation. What have you used? What was most helpful?
  • Mutal assistance with sites, modules, themes, and other Drupal-related stuff
  • Going to Drupalcon? What sessions look most interesting?

Hosted by the Institute for Advanced Study Computing Department.

Directions: There is a map of the IAS campus on this page - http://www.ias.edu/about/directions.

Bloomberg Hall is building 4 on the map, next to Parking Lot A. Parking is free and generally there are plenty of spaces. We will meet in the Physics Library, Room 201.

Comments

Looking forward to tomorrow's meetup

Posted by bg1 on March 2, 2011 at 2:02am

I am a ASP developer (actually more of a database/SQL developer) that is trying to get my arms around Drupal. I am hoping it will be possible to come away from tomorrow with a few specific examples of developing modules in Drupal 7.

In particular, I would like to see an example of a very, very simple Drupal 7 module that retrieves data from the database using a SQL statement, structures it as a form that goes to the client and then receives the update data and updates the database using another SQL statement.

If possible, I would then like to see a version of the same module using jQuery.

Finally, I would like to see how close one could come to the same solution using existing contributor modules (e.g. View, etc.).

Looking forward to meeting you all tomorrow.

Bill Graham

I would like to see some specific examples too

Posted by KunQian on March 2, 2011 at 3:26am

These seems are good examples to start with. Can I also see an example of how to theme a form?

Kun Qian

example.module for Drupal 7

Posted by pwolanin on March 3, 2011 at 2:05am

We discussed the Drupal 7 basics of writing a module to get data in and out of SQL. See also http://drupal.org/project/examples

example.info

name = Example
core = 7.x

example.module:

<?php
function example_menu() {
$items = array();
$items['example-page'] = array(
'title' => 'My page',
'page callback' => 'example_page',
'access callback' => TRUE,
);
$items['example-data/%example_data/edit'] = array(
'title' => 'Edit data',
'page callback' => 'drupal_get_form',
'page arguments' => array('example_page_edit', 1),
'access callback' => TRUE,
);
return
$items;
}

function
example_data_load($nid) {
if (!
is_numeric($nid)) {
return
FALSE;
}
return
node_load($nid);
}

function
example_page_edit($form, &$form_state, $node) {
$form['node'] = array(
'#type' => 'value',
'#value' => $node,
);
$form['title'] = array(
'#title' => t('New content title'),
'#description' => t('help goes here'),
'#type' => 'textfield',
'#default_value' => $node->title,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return
$form;
}

function
example_page_edit_validate($form, &$form_state) {
if (
strlen($form_state['values']['title']) == 0) {
form_set_error('title', t('title cannot be empty'));
}
}

function
example_page_edit_submit($form, &$form_state) {
$node = $form_state['values']['node'];
$node->title = $form_state['values']['title'];
node_save($node);
drupal_set_message('Saved the node');
$form_state['redirect'] = "node/{$node->nid}";
}

function
example_page() {
$result = db_query("SELECT n.title, n.uid, n.nid, u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.status = 1");
$rows = array();
$headers = array('title', 'owner', 'edit');
foreach (
$result as $node) {
$rows[] = array(check_plain($node->title), l($node->name, 'user/' . $node->uid), l(t('edit'), "example-data/{$node->nid}/edit"));
}
$content['table'] = array(
'#theme' => 'table',
'#header' => $headers,
'#rows' => $rows,
);

$content['hello'] = array(
'#markup' => '<h3>Hello world</h3>'
);
return
$content;
}
?>

Thanks for the help last week

Posted by bg1 on March 11, 2011 at 12:40am

Thanks to Peter and David for building a working module example working with databases. Thanks to everyone else for your patience since I realize my questions took almost the entire evening went to my questions.

Bill

Thursday next month

Posted by pwolanin on March 7, 2011 at 6:46pm

FYI, we talked baout moving the schedule from Wed to Thur to see if that works better for people - I know at least 3 people locally who want to come but can't do Wed.

Yes,

Posted by fnikola on March 7, 2011 at 7:11pm

Thursday works better for me

thursday is better for me as

Posted by tuphill on March 7, 2011 at 8:24pm

thursday is better for me as well, I might actually get to see the end of the meeting for once.

Thursday

Posted by Lantz on March 7, 2011 at 10:07pm

Sounds good to me too.

THU is great :-)

Posted by ksinha on March 8, 2011 at 3:29am

THU is great :-)

Thiusdays are better for me too...

Posted by ijf8090 on March 11, 2011 at 3:21pm

Am looking forward to finally getting one of these meeting.....

AltStyle によって変換されたページ (->オリジナル) /