How to start Programming with Drupal

nikitas - June 21, 2009 - 20:26

Hi.
I want to learn the drupal's API interface and everything else needed in order to be able to customize-fix-contribute coding for drupal.
What's the best way?
I'm a novice php and mysql programmer.

For a large part, it depends

marcvangend - June 21, 2009 - 21:50

For a large part, it depends on your learning style. Are you the hands-on type, who likes to start building something and learn on the fly? Maybe you like to learn by reading a book first that thoroughly covers all aspects of Drupal development? Or do you prefer a more task-oriented approach with tutorials and screencasts? If you can answer that question, I can give you a better advice.

Well

nikitas - June 22, 2009 - 06:42

basically what i did not mention is that i've already read and learned all the important 'keywords' of a drupal cms.Nodes,taxonomy,cck etc.
I understand how to theme a view ( providing a correct .tpl.php filename etc ) i know how to hack a .css template and build a view with views 2 etc etc.But what i need to understand ( i'm more task-oriented then probably :) ) is how does the translation system works and how i can build my 'small' custom modules quick and dirty.
If for example ( an issue i'm currently having ) the dhtml menu (when having more than 1 language ) does not work i want to know at which mysql tables to look and how the language translation system are built ( i've read about the t('') funtion ) in order to write my own quick fix about this and then injecting my custom javascript code and rendering my custom php-mysql script. ) . . . I also tried to read the forms api but it's not very helpful for a begginer . . . although i understand the process of how to build a basic drupal form anything else is blur.If for example i write a .php script and 'inject' it at a page ( node/my_example ) with the php input type enabled i can see drupal processing my custom php code.But i cant 'inject' custom javascript for example ( j-query and not moo toools or something else incompatible ).
p.s : Excuse my poor english .
p.s 2 : I have a million questions basically :D . . . so i think this will be difficult. . . for example something basically i need to know is this . . . how do i retrieve mysql data without making a new connection e.g mysql_connect(; ; ; ; ;; ) etc . . . and what is the name of this var ? etc etc . . . Little things that make our lives easier basically. . . if i call for a page e.g www.example.com/node/3 which vars are retrieved and which are saved inside the session etc etc.

That's a lot of questions

marcvangend - June 22, 2009 - 08:14

That's a lot of questions indeed. Of course you can also ask all of them in the forum (preferrably one by one) but I applaud the fact that you want study the basics of Drupal.

Keyz has already suggested a couple of good books. Personally, I really like Pro Drupal Development as a reference. Specific questions like 'how does t() work?' and 'what is the vid comlumn in that db table?' are all answered in that book, but it's not meant for people who don't even know which questions to ask (but you do, obviously). 'Using Drupal' is much more task-oriended; have a look at the TOC to see what I mean: http://oreilly.com/catalog/9780596515805/toc.html.

I haven't read Front End Drupal myself, but I'm not sure if I would recommend to start with learning about front end development (the theme system). I have seen many Drupal 'newbies' (including myself in my early Drupal days) who made the mistake of adding functionality in the theme layer (or in nodes), simply because they knew more about templates than about modules. The problem with that is that you're neglecting the foundation of every contemporary CMS: the separation between content (nodes), behavior (modules) and presentation (theme).

Another great resource if of course the drupal api documentation at http://api.drupal.org. It also contains a couple of well documented example modules which are a really good starting point when you're just starting to write your own modules.

Regarding your database question: you don't have to connect to the database, you can just use all commands from the database abstraction layer (see http://api.drupal.org/api/group/database/6).

thanx a lot!and 1 more thing

nikitas - June 22, 2009 - 09:44

i'm more 'curious' in learning how to build custom forms in order to import custom data into the mysql tables but in a right way.In order not 2 collapse other modules or drupal core system by my scripts of course.Plus i want to make custom menu navigation systems that provide a more flexible language independent system when it comes to vocab. and taxonomy issues for example.I see that drupal has a lot of power inside its core i just want to touch a little of that power to! ;) . . .
thanx for answering my questions.I'll try to keep up.
p.s :As for the forum i have over 10 questions without an answer!!!Ok i'm not complaining about that.But i find it rather 'unproductive' to wait for simple questions for days and days.
Thanx again.HAve a nice day.

When you say "build custom

marcvangend - June 22, 2009 - 10:38

When you say "build custom forms in order to import custom data" that raises some questions with me. Do you want to import programmatically (you wouldn't need a form for that), or do you want a user to enter data manually in a form (I wouldn't call that import)? And how do you want that data to be stored? As nodes, taxonomy terms, something else, something custom? I think that there are probably a couple of modules you could use, or at least build on.

Maybe it's also important to take one step back when you're asking questions. Instead of asking "how do I create a form for importing data" you could ask "this is my situation, this is my problem and I think I need a custom form now... am I right?". I think a forum topic like that might result in more and better answers.

oh i've seen the other

nikitas - June 22, 2009 - 11:30

modules about node import and taxonomy import and cvs import etc. . . But i want to learn the whole process . . .
For example i could use taxonomy csv import module to import my taxonomy terms and then build a custom form to have a user choose from them ( somewhere inside the submit content section ) . . . but the problem will still be there . .let me be more specific. . . ( i know that other modules or combinations of them might work for it but plz keep reading ) . . .
e.g :
I want to build a form that has a select field like this one http://remysharp.com/wp-content/uploads/2007/01/select.html where it autopopulates the second selector ( i know about ahah modules etc . . . but they are poor documentated ,only drupal guru works with ahah or is it just me? :) ) and other custom fields that can be imported into mysql .The problem is that i must be able to completely undestarnd where the cck values , where the node values and where the taxonomy values will be imported.Making data safe for importing etc. . .Now if i wanted to build something like that ( the form ) i mean it would be just a matter of minutes ( ok hour better ) with custom php programming and my custom code.
So if i wanted to write a script - form with an autocomplete option from taxonomy ( i cant find an answer to this although i'm searching for months now ) that autopopulates a second autopopulate field like the example from my link i would use the script from my link . . .
Anyway i must read some first and then come back. . . thanx a lot for your time appreciated . .. i'll try to follow your tips .

Have you seen

marcvangend - June 22, 2009 - 11:45

Have you seen http://drupal.org/project/hierarchical_select? I appreciate that you want to learn everything, but if you want to be efficient in Drupal, it's essential to learn how to work with existing modules. If you were my colleague, my advice for you would be to focus on the result and take a less steep learning curve by extending existing modules. If your goal is to learn the whole process, be confident that eventually, you will. Just allow yourself to ease into it.

If you prefer books, I

Keyz - June 21, 2009 - 23:20

If you prefer books, I strongly recommend Front End Drupal (read first), and then Pro Drupal Development, 2nd edition for the more in depth development. I haven't read them yet but two alternatives that I've heard good things about are Using Drupal (for intro) and Learning Drupal 6 Module Development.

There's also a module building guide and info in the handbook which I found helpful, and I wrote a simplified module guide to help you get a basic module up and running within a few minutes: How to create a simple Drupal 6 module in three easy steps. Once I had a basic module to work with, it was easy to begin trying things out and learning.

thanx!i am

nikitas - June 22, 2009 - 09:44

more into learning forms api and menu navigation and localization.

 
 

Drupal is a registered trademark of Dries Buytaert.