Hi , I am new to drupal and i want to create new page like abc.php but i don't want to create this page from admin section create content -> page / story ... bco'z it save the page into database ... i want to create new php page by my own and then let say call this from one of the menu item ( on click of the menu ) .. how can i do that ... and also wanted to know why drupal is saving all the page in database ... is for some optimization or achieve some functionality. ankur
What you want to do is possible, have a look at hook_menu, this defines the path for your page, but I don't really understand what's your objection to saving your data in the database. What is it you want to achieve? Best regards, Peter Droogmans Attiks Ketsstraat 94 2140 Borgerhout Belgium 32 3 288 61 17 32 497 44 44 77 From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Ankur Jain Sent: vrijdag 31 juli 2009 07:49 To: development@drupal.org Subject: [development] Query about new page Hi , I am new to drupal and i want to create new page like abc.php but i don't want to create this page from admin section create content -> page / story ... bco'z it save the page into database ... i want to create new php page by my own and then let say call this from one of the menu item ( on click of the menu ) .. how can i do that ... and also wanted to know why drupal is saving all the page in database ... is for some optimization or achieve some functionality. ankur
i just wanted to know why drupal is saving all the page content in database .. if we have many pages then it may slow down the database and also page loading. On Fri, Jul 31, 2009 at 12:14 PM, Peter Droogmans <Peter@attiks.com> wrote:
What you want to do is possible, have a look at hook_menu, this defines the path for your page, but I don’t really understand what’s your objection to saving your data in the database. What is it you want to achieve?
Best regards,
Peter Droogmans
Attiks
Ketsstraat 94
2140 Borgerhout
Belgium
32 3 288 61 17
32 497 44 44 77
*From:* development-bounces@drupal.org [mailto: development-bounces@drupal.org] *On Behalf Of *Ankur Jain *Sent:* vrijdag 31 juli 2009 07:49 *To:* development@drupal.org *Subject:* [development] Query about new page
Hi , I am new to drupal and i want to create new page like abc.php but i don't want to create this page from admin section create content -> page / story ... bco'z it save the page into database ... i want to create new php page by my own and then let say call this from one of the menu item ( on click of the menu ) .. how can i do that ... and also wanted to know why drupal is saving all the page in database ... is for some optimization or achieve some functionality.
ankur
That's way Drupal has several layers of caching, the biggest advantage of a database is that's easy to move your site or for heavy visited sites you can use several front-end web servers to serve page. Amongst many other benefits of using a database (multi-user, stable, easy to backup, ...) Regarding the speed, a good database running on a decent server is as fast as file I/O From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Ankur Jain Sent: vrijdag 31 juli 2009 10:26 To: development@drupal.org Subject: Re: [development] Query about new page i just wanted to know why drupal is saving all the page content in database .. if we have many pages then it may slow down the database and also page loading. On Fri, Jul 31, 2009 at 12:14 PM, Peter Droogmans <Peter@attiks.com<mailto:Peter@attiks.com>> wrote: What you want to do is possible, have a look at hook_menu, this defines the path for your page, but I don't really understand what's your objection to saving your data in the database. What is it you want to achieve? Best regards, Peter Droogmans Attiks Ketsstraat 94 2140 Borgerhout Belgium 32 3 288 61 17 32 497 44 44 77 From: development-bounces@drupal.org<mailto:development-bounces@drupal.org> [mailto:development-bounces@drupal.org<mailto:development-bounces@drupal.org>] On Behalf Of Ankur Jain Sent: vrijdag 31 juli 2009 07:49 To: development@drupal.org<mailto:development@drupal.org> Subject: [development] Query about new page Hi , I am new to drupal and i want to create new page like abc.php but i don't want to create this page from admin section create content -> page / story ... bco'z it save the page into database ... i want to create new php page by my own and then let say call this from one of the menu item ( on click of the menu ) .. how can i do that ... and also wanted to know why drupal is saving all the page in database ... is for some optimization or achieve some functionality. ankur
On Friday 31 July 2009 3:25:57 am Ankur Jain wrote:
i just wanted to know why drupal is saving all the page content in database .. if we have many pages then it may slow down the database and also page loading.
The rest of the replies in this thread are valid, but I think right here is your first mistake. In a properly designed database, the performance difference between 5 pages, 5000 pages, and 50,000 pages stored in the database is almost unmeasurable. Just saving lots of pages in the database is not itself going to slow down your database or page loading unless you're doing something very stupid with your database. Drupal's default database usage is, while not completely optimal, at least fairly good especially given the flexibility it has. Once you've made the decision to store one page in the database (which you have by using Drupal at all), the added cost of storing the next 10,000 pages in the database is virtually nil. Now, if you're loading a lot of different page requests per second because it's a high traffic site, then you start dealing with performance questions. However, that depends on the number of requests you have, not the number of pages you have. You're trying to optimize the wrong thing. -- Larry Garfield larry@garfieldtech.com
Drupal is a content management system. Any piece of content (node) is stored in the database, because it is created by someone who has certain permission, created on a certain date, can have comments, votes, points, ...etc. Can be organized in taxonomy, book, and the like. You are better off converting the .php file that you talk about into a Drupal module (.info and .module at a minimum), and having a hook_menu for it to be called as a path, so instead of example.com/something.php, it would only be example.com/something. If you insist on having external PHP, it is best to bootstrap Drupal in them and then use Drupal's API normally afterwards, so something.php will be like: <?php require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); // your code here ?> Having said that, if you have more than a few of these, or worse, you plan to have a lot of HTML markup in them, then you are doing something wrong, and not using Drupal correctly. On Fri, Jul 31, 2009 at 1:49 AM, Ankur Jain <ankur.khicha@gmail.com> wrote:
Hi , I am new to drupal and i want to create new page like abc.php but i don't want to create this page from admin section create content -> page / story ... bco'z it save the page into database ... i want to create new php page by my own and then let say call this from one of the menu item ( on click of the menu ) .. how can i do that ... and also wanted to know why drupal is saving all the page in database ... is for some optimization or achieve some functionality.
ankur
-- Khalid M. Baheyeldin 2bits.com, Inc. http://2bits.com Drupal optimization, development, customization and consulting. Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra Simplicity is the ultimate sophistication. -- Leonardo da Vinci
participants (4)
-
Ankur Jain -
Khalid Baheyeldin -
Larry Garfield -
Peter Droogmans