[support] Write a text into a page like a node
Ivan Sergio Borgonovo
mail at webthatworks.it
Wed Jan 9 01:35:41 UTC 2008
On Wed, 09 Jan 2008 01:46:24 +0100
Davide Michel 'ZioBudda' Morelli <michel at ziobudda.net> wrote:
> Hi all and sorry for this stupid question (any RTFM is wellcome).
>
> I want to create a page (say foo.php) inside a bar/ directory that
> when call display me (via browser) some info stored in a variable
> ($foo). So I have $foo, I have my themes, I have my bar/foo.php
> url, but how can I do an all in one ?
>
> This is my simple code for bar/foo.php:
>
> <?
>
> require_once '../includes/bootstrap.inc';
> drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
>
> $page = "io sono la pagina";
> echo theme('page',$page);
>
> ?>
>
> And the php-error is :
>
> PHP Fatal error: require_once() [<a
> href='function.require'>function.require</a>]: Failed opening
> required
> './includes/cache.inc' (include_path='/opt/www/newzb/:.:..')
> in /opt/www/newzb/includes/bootstrap.inc on line 895
>
> If I move foo.php from bar/ to / and changhe ../includes
> in ./includes all works.
I bet because paths in bootstrap.inc are relative.
Wouldn't it be better to write a custom template for that page?
You can redefine the *whole* page. You just have to write a custom
page.tpl.php. It is described at page 115 in Pro Drupal Developement.
There are some modules that let you change the first page too etc...
I wouldn't work against the CMS and its api.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
More information about the support
mailing list