Hi All,

I've Drupal 7 up and running - and a basic website with a non default theme (adjusted by me)
some cool modules like font-your-face etc.
But all-in-all it is plug and play so far - and things are working great.

Now I am at the point were I need something 'custom' - although I do understand the basics behind nodes, view & blocks etc. I feel I do NOT fully grasp the concepts just yet.

What I need is somebody who can explain a best practices (in D7) to do 2 things:

I have 1 basic page that requires a small php script to display a table based on the current year.
(So players can figure out in which age group they are Novice/PeeWee/Bantam/...)
I do have the PHP code but I have no idea where to insert it in this massive drupal infrastructure...

Problem 2 is I need some guides to create custom 'player profiles' on a lacrosse website.
I made a new content type with 20+ fields - but using the 'default' way of display it wasn't that great.
DO I create a custom page.tpl or node.tpl or a bunch of field tpl's???
Not so sure there.

Bonus question anybody aware of a module that can export a page (playerprofile) to a PDF - with the click of a button?

Thanks

Peter

Comments

p55mac’s picture

Problem 1

A custom block might be the easiest solution
Goto sHome » Administration » Structure » Blocks
Add Block
Enter block title if appropriate
Paste the script into the block body
Text format should be set to PHP code*
At the bottom of the page under Show block on specific pages Select Only the listed pages radio check and enter your node url in the field below

* You most likely have to first enable PHP code as a text format to do this
Enable PHP filter modules
Goto Home » Administration » Configuration » Content authoring
Enable PHP Code

Problem 2

I would recommend creating a node--[conten-type].tpl.php
When I first did this myself this tutorial was helpful:
http://www.ireckon.com/drupal/tutorial-how-to-make-a-better-ubercart-pro...
Under step 6 I downloaded the project files and reverse engineered from there.

Bonus Question

http://drupal.org/project/print

Not necessarily best practice. But might be a help - good luck.

PeterLinuxGeek’s picture

Thx p55mac.

With your pointers for Prob1 I figured out that one has to enable the php-filter under the core module...

In the end I will need ubercart for player registration... so will certainly look at the ireckon link.

Looks like the print module does what I need - challenge will be to figure out to pdf only part of the page/content - but that is for later.

Thx so much - back on track.

Peter

p55mac’s picture

To PDF only part of the page you customise the print template file for pdf.
Drupal 7: print[--html|--mail|--pdf][--node--node-type].tpl.php located in the current theme directory.

e.g print the relevant fields in your print--pdf--player-registration.tpl.php file (player-registration is [node-type])