Hello all, I'm new to Drupal.

I'm currently looking for a way to make pages call Drupal API functions to get content instead of letting Drupal writing all the pages by itself.

That is my biggest problem with CMS applications. I love the way they can manage content, but when doing so, you're usually enslaved to put everything in one directory and to only use one theme. That is the reason why I don't like phpBB and XOOPS, while I stoped using LiveJournal.

At this time, I'm developing multiple sites: some by myself and some others with people. All of them are hosted in the same webspace, but each has its own domain. I haven't deployed Drupal yet, but I did take a look at its features and its source code. What sold me on it so far is its capability to use usernames from other Web sites and its modular code. Also the fact that users can use true HTML tags, which are filtered by the application, is really a Good Thing(R)!

I believe that, theorically, to get a seperate content and design on each Web site, the best way to do it would be to install one Drupal per site, which starts to take some unnecessary space. Also, that would create useless and repetitive tables in my database while I'm also trying to make the sites all share usernames, so you don't have to register each time to go on a different site I've made. One more thing I'd like is to not make my sites and my linking submit themselves to Drupal's URLs. I would like to use my own.

What I'm trying to do is to make my own pages which, if needing to read forum threads, for example, would read the content using the Drupal API then format and output the gathered data dynamically, instead of using Drupal templates. That way, I could make any page different, if I so desire, and have my own URLs, while still being able to use forums and blogs.

I did my own API before, and I was able to use it in such a way, but I don't have much time to code in all the features I would like it to support, which Drupal already do. I've used my own API, which I call 'Remix', only once, at www.LucGauvin.com. I can show you some of the code if you'd like, but let me warn you in advance that it's quite messy.

I've looked at Drupal's source code, but not in detail. I can see the code is much more modular and reusable than, for example, phpBB. So I was wondering if it's possible to do what I'd like to do. Is there any one who can help me with that, tell me what is the first function it calls or how it uses templates? That could be a good starter for what I'm trying to do.

Thanks in advance!

Comments

robertDouglass’s picture

I'm not sure if I understand your desires or requirements at all, but it would probably be interesting for you to look at the way xmlrpc.php works with Drupal. In particular the way that it includes four files and then has the entire Drupal API available. In fact, you only need two; bootstrap.inc and common.inc. If you really don't want to be tied to the Drupal way of doing things but want to use the data model and the great code, you can just include these two files and start hammering away. Most likely, though, if you really take the time to understand the hook system and the theme system, you won't feel limited in any way. This is how it was for me. Drupal does things differently than I had ever seen before (especially since I came from the Java world where a small set of ideas seems to rule every open source project there is), so at first I felt very hemmed in by the system. Now, though, after taking the time to read the handbook, do some coding, and especially after understanding the hook system, I love developing with Drupal and would never willingly develop on another platform.

- Robert Douglass

-----
visit me at www.robshouse.net

escoles’s picture

... is because it's nearly impossible to figure out how to do simple things like write out the name of a node's author, without writing out the string of links to which it belongs.

Definitely need some better API documentation, here; or maybe just a bunch of new API calls. As-is, creating a decent template is a very, very painful process, requiring intimate knowledge of Drupal internals, when it should be simple.

killes@www.drop.org’s picture

Ok, some hints for you (search the site):

1) Drupal allows to share database tables between sites (if on the same server).

2) You can have different themes for each site.

3) You can have different themes on different sections of a site (section module in contrib)

4) with upcoming Drupal 4.6 you can have only one copy of the Drupal files and serve as many sites from them as you like.
--
If you have troubles with a particular contrib project, please consider filing a support request. Thanks. And, by the way, Drupal 4.6 will support PHP 5.