2

So I have my page-front.tpl.php and page.tpl.php. I'm making a music website for a client and literally only need like 5 or 6 pages. How can I basically make a php page from scratch for each page? Thank you.

P.S. I think I'd rather make it all from scratch than use panels

2

Drupal has flexible theme system. You can create different sections of your site and theme and select dedicated template according to path. This is what I am suggesting you.

e.g. your site has different pages(paths) targeting different sections.

  • example.com/music (page-music.tpl.php)
  • example.com/artist (page-artist.tpl.php)
  • example.com/artist/profile/% (page-artist-profile.tpl.php)
  • example.com/store (page-store.tpl.php)
5
  • Shouldn't those template file names use two dashes by any chance instead of just one? – Maciej Zgadzaj Jul 2 '11 at 22:37
  • Two dashes scheme introduced in Drupal7 – Shoaib Nawaz Jul 2 '11 at 22:38
  • 1
    Ah, yes, sorry, my bad, we're talking about D6 here... – Maciej Zgadzaj Jul 2 '11 at 23:01
  • EXACTYLY what I was looking for. Wow, that's so obvious. the dashes are simply arguments. That makes sense since it's page-FRONT.tpl.php. Nice, thanks man. – Graham Jul 18 '11 at 0:37
  • OK, I mighta jumped the gun on my exitement there. Is this a common problem: When I make the page-ayo.tpl.php or whatever it is, it says, "page not found" at the top. However, the page shows. But, the admin menu doesn't work and I can't use CCK/ other modules. Also, when I make content and use Path auto (to define the same url as the template) along with CCK, the content is shown. But the template no longer is hooked to it. Would you know what going on here? Thank you. – Graham Jul 18 '11 at 0:57
1

In Drupal you do not really make php pages "from scratch", as this is done for you by themes. What you do though (and this is what you probably would want to do too) is define views + probably blocks for all your required page areas, and then position/style them using CSS (and usually no panels required, most could be done using properly thought-over page structure and good styling).

4
  • K, so I'm just a little confused on views. I've tried using it for related search by terms, but not for what your talking about. How would I define the views in the way your talking about? I've definitely made blocks of random content, but not views. Sry, just a little weirded out/confused on the whole concept of what views should and should not be used for. Thank you! – Graham Jul 2 '11 at 21:15
  • Just to provide what I'm actually doing... It's a simple music site for a musician -- front page, contact, music, bio, and shows. But, each page will have a totally different layout. I'd rather do it from scratch for this particular project, but I want to use Views slideshow, contact functionality, and obviously let him update events through a user friendly CMS. So ya, just 5 pages with all different layouts. – Graham Jul 2 '11 at 21:19
  • Ok, perhaps I should have started with a question what you actually want to display on those pages? As Views are used for listing content rather than displaying it as a whole. (Read more on Views here: drupal.org/node/109604) So if you would want to list your musician's shows/events, you would use Views. If it's going to be a simple page with static content, then as you said yourself, you could just put it in the block and display on page (for example creating empty/short page earlier.) – Maciej Zgadzaj Jul 2 '11 at 21:29
  • Awesome, thanks for pointing me in the right direction. – Graham Jul 2 '11 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.