This forum is for assistance with theme development.

How to merge two _phptemplate_variables functions

Hi all! I'm using two features based on a function called _phptemplate_variables.

The first one is for showing different page templates depending on URL aliases:

<?php
function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'page':
   
      // Add page template suggestions based on the aliased path.
      // For instance, if the current page has an alias of about/history/early,
      // we'll have templates of:
      // page_about_history_early.tpl.php
      // page_about_history.tpl.php
      // page_about.tpl.php
      // Whichever is found first is the one that will be used.
      if (module_exists('path')) {
        $alias = drupal_get_path_alias($_GET['q']);
        if ($alias != $_GET['q']) {
          $suggestions = array();
          $template_filename = 'page';
          foreach (explode('/', $alias) as $path_part) {
            $template_filename = $template_filename . '_' . $path_part;
            $suggestions[] = $template_filename;
          }
        }
        $vars['template_files'] = $suggestions;
      }
      break;
  }
 
  return $vars;
}
?>

The second one is for showing different node templates based on the UID of the node publisher:

<?php
function _phptemplate_variables($hook, $vars) {
$variables = array();

Adding multiple blog entries in main page (index)

I was wondering if there was a way for a homepage to show two drupal entries at once side by side. I was planning on blogging on one side and having a photo area on the other.

I would greatly appreciate any help, I attached an image for reference.

http://www.eprimedesigns.com/ul/files/1/wordpress1.jpg

adding header to custom blog layout

How does one go about adding a header to a custom blog layout when using node-blog.tpl.php, not Views?

Changing the header in garland theme

Hello,

I was interested in knowing if someone could explain to me how to change the default header in the garland theme. I wish to replace it with an image made by myself.

For reference of what im talking about, please visit mydigitaldingo.com/animosity

want to convert some themes to drupal, suggestions please

I'm planning to convert some themes from Wordpress/OSWD/etc. to Drupal and release it to the community.

Any suggestions would be welcome!

Pages

Subscribe with RSS Subscribe to RSS - Theme development