Drupal and regular PHP integration

I am creating a new website with one main application and many pages of content. Content pages are mostly dynamic, and I need a way to manage this dynamic content on a regular basis. The main functionality of the main application is a three-step process, or reading user data (login page), reading data from MySQL (product page) and sending the application to an email address (application page).

Ideally I would like to create a main application in regular PHP and use Drupal for its content management capabilities. Can Drupal and regular PHP be integrated as I suggest easily? I feel like coding the main application as the Drupal module will add layers of complexity that can be difficult to compile from the start and then maintain as the system matures, so I'd really like to just use regular PHP.

Let me explain where the dynamic content (managed by the CMS) overlaps with the main application:

Dynamic content, such as FAQ data, is used in both "normal" help pages and in the mini-feed displayed on the main application pages on the right side. In this column 3, random questions are pulled from the database and displayed as a feed. When users click on an FAQ question, they are not removed from the main product page of the application, but are displayed in a pop-up window displaying a question and answer. In addition, users can view other questions and answers through a simple navigation menu in this pop-up window. There are 3 types, as I describe above, that are required on the main application product page.

So what is the ideal solution here in terms of "keeping things simple" for managing dynamic content and making the main application easy to code? Can "regular PHP" and Drupal coexist "peacefully"? If so, how is this technically possible? Since there is some Drupal managed content contained in the main pages of the application, can the main application still be coded in regular PHP?

Any tips / suggestions? Thanks! Jim.

+2


a source to share


2 answers


This is part of a post that I presented a few years ago. Unfortunately the linked article is long gone, but it might be relevant to your needs:
Importing standalone old style PHP scripts into a Drupal system Drupal
system is a very strong CMS, but using an existing PHP site and trying to get it to Drupal can be difficult ... The "correct" way to convert a site to Drupal is "Drupalize", which means doing all the "Drupal way" that really needs to be done, but in some cases, not everyone agrees.

I had an example with a company that has many HTML / PHP based sites. They heard about the flexibility and power of Drupal and decided it was their choice for the revolution. But, on the other hand, they want not to change anything and that I will do it as quickly as possible.

The "right way" to do this was to break each PHP script into their own parts, find shared resources, create the right methodology with existing Drupal modules, and fill in the blanks with my own add-on module.



But that's not what they asked me to do, instead I was looking for a way to simply import an existing PHP script into the Drupal environment.

Searching for an existing solution led me to the proof of concept described by Dan Morrison . On the bottom line, it uses the PHP output buffering commands it orders to collect everything the old script does and then display it as part of a Drupal module. In my case, I had to make a small change (mainly to pass variables from the request to PHP in the appropriate scope), but on the bottom line, it did exactly what I needed. Well, almost ... In other cases, when I wanted to use the Drupal API, I handled it differently, as I describe below.

+1


a source


It sounds like you are asking about two things:

  • Including Drupal content in a custom PHP application.
  • Displaying Drupal content in a popup from a PHP application.


There are several different levels of integration: if your need is as simple as pulling content onto a page, then you can simply create a view ( http://drupal.org/project/views ) with that content from Drupal, which you can make available. and then include it in your web app.

If you are looking for tighter integration between the 2, including sharing users, sessions, etc., then this is most likely β€œpossible” as well, but will require more information to figure out what you need.

0


a source







All Articles