Hi

I'm new to PHP, and Drupal theme dev.

I found a realy cute theme, that I want to use it on my website. You can find it here.

So, i'm new to Drupal / PHPTemplate / PHP and I need some help.

My first problem is that this theme is using a ID="current", for the current link, from the primery links. My first solution was to skip that. But , it could be nice to make it, or just to learn how could I do that ( the print loop, doesn`t have control on that ).

So, if you could: Replay with some links to some good and professional tutorials ) I`v read the handbook on theme dev. but doesn't help much :( ) And a personal opinion on about this theme. Is it easy to port on drupal? is it good for drupal, or needs some css adjustments?

My next step will be to look at other theme code. And hope to understand something from it.
I will make this theme public if I succes to make it good. ( more generic than the need 4 my website ).

P.S. Sorry 4 my english. And waiting 4 some useful links/answers.

10x

------------
o0nix

Comments

Anonymous’s picture

I like the theme. Here's how the Antique Modern theme handles the problem with active primary menu items. This is from the template.php file. Sorry if this is over your head. You can email me directly if you need more help.

<?php
/**
 * Not really a theme function, but it lets us do our menu with nice tabs,
 * and keeps the active item active.
 */
function phptemplate_menu_links($items, $type = 'ul') {
  if (!empty($items)) {
    $output .= "<$type>";
    foreach ($items as $link) {
      $active = '';
      if ($_GET['q'] == $link['href']) {
        $active = ' class="active"';
      }
      $output .= "<li$active>\n";
      // Is the title HTML?
      $html = isset($link['html']) && $link['html'];

      // Initialize fragment and query variables.
      $link['query'] = isset($link['query']) ? $link['query'] : NULL;
      $link['fragment'] = isset($link['fragment']) ? $link['fragment'] : NULL;

      if (isset($link['href'])) {
        $output .= l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment'], FALSE, $html);
      }
      else if ($link['title']) {
        //Some links are actually not links, but we wrap these in <span> for adding title and class attributes
        if (!$html) {
          $link['title'] = check_plain($link['title']);
        }
        $output .= '<span'. drupal_attributes($link['attributes']) .'>'. $link['title'] .'</span>';
      }
      $output .= "</li>\n";
    }
    $output .= "</$type>";
  }

  return $output;
}

Doug

unixforge’s picture

10x. This is a start for solving my "current id" problem.

But any link to some good tutorial is welcome. *( I need to doc. hard to get this theme well done )

unixforge’s picture

i'm using the <?php print $site_slogan ?> for the slogan, and no effect :((. In garland apears. but when I'm using my theme... no.

What couses the problem? Info: in my theme dir, i have only page.tpl.php, the style.css, and some *jpg`s.

And to mention that, int my header @ title tag, when I print $head_title apreas mysitename | myslogan. But never when I use, $site_slogan ?

8manj-dupe’s picture

Is the site slogan set to display within your admin settings??

Have a look at admin -> build -> themes -> settings and make sure the site slogan is ticked for your theme