How to add new page tp Drupal theme?

_Swede_ - October 1, 2008 - 08:35

I am having this simple problem. I would like to add subpages to my theme (fblike) and access these new ”php pages” with a normal URL on my start page. How do I do this?

The best solution would be to have access to the userid, like <base address>/newpagename/5

No menus needed just a plain old URL.

Dont know exactly what you

betz - October 1, 2008 - 10:13

Dont know exactly what you want, but you can get the user id with:

$user->uid;

The userid is secondary. I

_Swede_ - October 1, 2008 - 10:23

The userid is secondary. I just want to add a new page that holds new information, e.g. list of new employees, that is not editable by users.

Please be more specific on

betz - October 1, 2008 - 10:28

Please be more specific on what you want.
Everything depends on that.

If you want to make just a single page with some content in it, (so not dynamically) you can make a new page by clicking on 'create content' in the navigation menu. Here you click on page, the rest speaks for itself i suppose.

Ok, an example. I would like

_Swede_ - October 1, 2008 - 10:34

Ok, an example. I would like to:

1. Create a new page, lets say: employedata.php. Hand coded by me.
2. Add this to the Drupal CM to show up under URL /employee/<id> just as right content like a user-profile page.
3. Add this URL in link on my main page.

Is this possible?

Ok, yes you can do that. 1.

betz - October 1, 2008 - 11:03

Ok, yes you can do that.

1. enable the path module at admin/build/modules
2. create a new page at node/add/page
3. paste your phpcode at the body textarea
4. under the textarea you can choose the input format, choose php
5. give the url where you want the page be available

Thanks! Where do I find the

_Swede_ - October 1, 2008 - 11:30

Thanks!

Where do I find the node/add/page?

If I select Create new content and page. I will only have these options after selecting the path module:

-Menu settings
-Input format
-Revision information
-Comment settings
-Authoring information
-Publishing options

No path field.

one word VIEWS Then you just

gettingpissed - October 1, 2008 - 11:58

one word

VIEWS

Then you just have to "make" a new employee (like you were making a page) and it will automatically show up... lots of oppertunities there...

Edit: btw, path field requires path to be enabled, its a standard module btw...

You need this if you're gonna make a website

Ok, I think I will go with

_Swede_ - October 1, 2008 - 12:00

Ok, I think I will go with the custom page option anyway.

But where can I set the path to my new page?

you need to enable the path

gettingpissed - October 1, 2008 - 12:02

you need to enable the path module...(its a default) the pathauto module would help too...

but still, don't underestimate views, every issue you create is in a million views lists on this site... very handy...

You need this if you're gonna make a website

 
 

Drupal is a registered trademark of Dries Buytaert.