This forum is for assistance with theme development.

Must CSS be used?

Hey all,

Looking to finally start changing the standard theme of my Drupal site. I'm curious though if the CSS must be changed to create new themes, or can we do it the oldschool way where you create a design in photoshop, slice it up, and then use that HTML to put over it?

Is it possible to do it the slice way somehow? Or would that be way hard, resulting in the change of CSS to be easier.

Thanks,

- B

Theming nodes in different regions in CSS

Kia ora everyone,

I've just made the switch to 4.7. I'm designing a website for a supermarket campaign. I want to be able to put a block in the header region but designed completely different to the right side bar or the left side bar.

My question is, how do I do this?

Simon

Change theme based on user role

I am using PHPTemplate. I have seen code to change the theme for different node types using the phptemplate_variable function and defining a template.php file. I have also seen some snippets to access the user role and turn off and on content based on the role, but it doesnt seem to work when I try to do this in the template.php file. here is my code:

Making Drupal Taxonomy Links Happy with rel-tag specification

I've recently been fighting to get technorati to pick up tags from my drupal site. I discovered that we're still not really confroming to the spec for the rel-tag microformat:

http://microformats.org/wiki/rel-tag

Becasue the end of all taxonomy urls is a numeric ID, the tags are read by spec-mindful web services as numbers. This can be solved on a tag-by-tab basis with path_aliases, but I need an automagic solution.

With a little investigation, it became clear that additional arguments on the url will be ignored by taxonomy.module by default, so I made an override for theme_links() that tacks on a rel-tag-friendly addition to the url.

This only works with clean_urls enabled, but if you don't have those on, you're screwed in any case:

function phptemplate_links($links, $delimiter = ' | ') {
  if (!is_array($links)) {
    return '';
  }
  if (variable_get('clean_url', FALSE)) {
    // this only works for clean urls
    $newlinks = array();
    foreach($links as $link) {
      if (strstr($link, 'rel="tag"')) {
        $result = preg_match('!\>([\w\s]*)\<!', $link, $tag);
        $link = preg_replace('!href="([\w\/]*)"!', 'href="${1}/'.drupal_urlencode($tag[1]).'"', $link);
      }
      $newlinks[] = $link;
    }
    return implode($delimiter, $newlinks);
  }
  else {
    return implode($delimiter, $links);
  }
}

HEAD has the new and shiny hook_link_alter, which will provide a much "cleaner" way to do this, but for now I think this works.

FriendsElectric and Tables don't mix - white space problem

When I add content to my site that contains table markup, it adds an endless amount of whitespace before the content. Has anyone else had this problem with this theme? As soon as I remove the table tags, problem solved.

Pages

Subscribe with RSS Subscribe to RSS - Theme development