Newbie Question - PHP site conversion

Events happening in the community are now at Drupal community events on www.drupal.org.
shirleyto's picture

Hi there,

I'm a super newbie to Drupal and I'm given the task to convert an existing PHP site to Drupal. I've installed Drupal 6.9 and downloaded a few modules (cutemenu, tinymce, lightbox2, jquerymenu, cck) and tried to see if I could at least replicate the homepage in Drupal.

If I may ask some of my (many) questions here:

  1. What should I do with the numerous include files in PHP? Should I create a "Page" for each of them, and include them in other "Page"s like they're PHP includes? Or is this not the right approach with Drupal?

  2. For existing DHTML menus, should I forget about the current code and build them from scratch with modules (trying that with "cutemenu" at the moment)?

  3. And with the existing PHP pages, should I import them all into the Drupal database somehow? But I think this will break all internal links?

  4. With site conversion projects like what I'm trying to do, is the original code usually not useful?

Thank you for your time!

-shirley

Comments

Great Question

apperceptions's picture

Welcome to Drupal. Without knowing specifics, I can only give some very general responses. Perhaps others can elaborate if you share more details. BTW, can anyone recommend the best intro Drupal book for addressing these kinds of questions?

  1. This depends on what those include files do. Most likely, you will want to convert these into drupal modules that you put into your sites/all/modules folder. You may find that you can write a kind of "wrapper" module that includes your code and uses Drupal hooks to pass results to the theme.

  2. Yes.

  3. If you are referring to static html pages, you can either recreate them via cut and paste or look into importing if there are a large number of pages. Import ease will depend on how they are currently stored. There are many ways to import data into drupal so hard to be specific. If you have existing data that you need to access, look into defining custom content types using CCK and then import the existing data. Alternatively, you could import existing tables and create a module that accesses those tables directly. Check out http://drupal.org/node/133705

  4. It depends on how modular your code is. If you can factor out the biz logic, you may be able to reuse that. Let Drupal handle the UI and content management.

--

Markus Sandy
http://apperceive.com
http://ourmedia.org

Thanks, Markus

shirleyto's picture

Hi Markus,

Thanks for your response, and thanks for bringing up the topic on an intro book. The include files on the site are mostly for common things like the menus/navigation, snippets of pages, links to css, region detection code... stuff like that; looking at those now, I only need to turn the region detection code and the snippets into modules? I'll see what I can do with the rest.

The site is not heavily database driven and there's not much biz logic at the moment. There are some pages that access a database (for retrieving information, not for storing), there's a news page (WordPress) and some forms post to a ERP/CRM software (Netsuite), I'll check out the link you provided. Hopefully I'll have a clearer picture soon!

Thank you!

-shirley

FYI

apperceptions's picture

Drupal themes support a concept of regions.

--

Markus Sandy
http://apperceive.com
http://ourmedia.org

Using Drupal

snorkers's picture

I'd really recommend Using Drupal (o'Reilly Dec 2008), which was put together by the Lullabot team. There's a gentle intro to Drupal, then 10 case studies using various modules, walking you through gently. There's also a long chapter on theming, with a few useful appendices (most importantly installing). Once you've cracked this book, I'd recommend Pro Drupal Development (Apress 2008), which goes into far greater technical detail in pretty much every aspect of Drupal; but you need to understand the basics before diving into this book.

"Using Drupal"

shirleyto's picture

Thanks for the recommendation on the book, Robert. I checked it out on Amazon and it seems like I'll be getting a copy tonight.
I actually had bought Pro Drupal Development... yup, I really had no idea and was ahead of myself.... blush

-shirley