How does one inject variables into page templates from a custom Drupal module?

Posted by Michael T. Smith on Stack Overflow See other posts from Stack Overflow or by Michael T. Smith
Published on 2010-05-05T21:12:59Z Indexed on 2010/05/05 21:18 UTC
Read the original article Hit count: 355

We've created a custom module for organizing and publishing our newsletter content.

The issue I'm running into now -- and I'm new to theming and Drupal module development, so it could just be a knowledge issue as opposed to a Drupal issue -- is how to get each newsletter themed.

At this point the URL structure of our newsletter will be:

/newsletters/{newsletter-name}/{edition-name}/{issue-date} which means that we can create template files in our theme using filenames like page-newsletters-{newsletter-name}-{edition-name}.tpl.php, which is great. The one issue I'm running into is that all of the content comes through in the $content variable of the theme. I'd like to have it come through as different variables (so that I can, inside the theme, place certain content in certain areas.)

Is there a proper way for doing this?

© Stack Overflow or respective owner

Related posts about drupal

Related posts about drupal-6