This forum is for assistance with theme development.

Obsidian flavour for Manji theme

I have added Obsidian flavour by ScottDot to the Manji theme package.

It makes use of the same XHTML structure, only with different CSS and graphics. See a test page here http://sandbox.ichris.ws/obsidian

If you are already using Manji, you need to overwrite the existing files with ones in the new tarball. There is 2 lines of code added to the XHTML template.

Style by Node in PHP Template

I am trying to implement a fairly complicated graphical header bar that varies by the section you are in. The sections happen to correspond to node types, so at this point if I could just get

print $node->type;

or

print $node_type;

to return something helpful, I'd be off to a great start. Any suggestions?

The forums contain a few discussions of similar topic but none that got me where I was trying to get.

Drop-down menu and bug of search function of Manji

Well, it prohibited my posting because of suspicious data, so I just give the link,

http://vitamin.uni.cc/node/23

Proper theming of aggregator module

So I am trying to get some customize aggregator content on my site, howver I am having some problems theming the module. The aggregator module has a theme_aggregator_page_item hook, which allows me to create an aggregator_page_item.tpl.php file in my theme folder. I am using PHPTemplate by the way. I activate this theme file by modifying my template.php file. Everything works fine, except for the fact that now each time the theme_aggregator_page_item function is called in the aggregator.module, I get a new date. So my page looks like:

Date1
News Item
Date1
News Item
Date1
News Item
Date2
News Item

Instead of :
Date1
News Item
News Item
News Item
Date 2
News Item

I know why this is hapening. It is because in my aggregator_page_item.tpl.php file there is a bit of code that isn't working. Here is the file:

  static $last;

  $date = date('Ymd', $item->timestamp);
  if ($date != $last) {
    $last = $date;
    $output .= '<h3>'. date('F j, Y', $item->timestamp) ."</h3>\n";
  }

  $output .= "<div class=\"news-item\">\n";
  $output .= ' <div class="date">'. date('H:i', $item->timestamp) ."</div>\n";
  $output .= " <div class=\"body\">\n";
  $output .= "  <div class=\"title\"><a href=\"$item->link\">$item->title</a></div>\n";
  if ($item->description) {
    $output .= "  <div class=\"description\">$item->description</div>\n";
  }
  if ($item->ftitle && $item->fid) {
    $output .= '  <div class="source">'. t('Source') .': '. l($item->ftitle, "aggregator/sources/$item->fid") ."</div>\n";
  }

  $result = db_query('SELECT c.title, c.cid FROM {aggregator_category_item} ci LEFT JOIN {aggregator_category} c ON ci.cid = c.cid WHERE ci.iid = %d ORDER BY c.title', $item->iid);
  $categories = array();
  while ($category = db_fetch_object($result)) {
    $categories[] = l($category->title, 'aggregator/categories/'. $category->cid);
  }
  if ($categories) {
    $output .= '  <div class="categories">'. t('Categories') .': '. implode(', ', $categories) ."</div>\n";
  }

  $output .= " </div>\n";
  $output .= "</div>\n";

  echo $output;

The problem is that the $last variable doesn't seem to get passed through the themeing functions of the aggregator module. Is there anyway to fix this WITHOUT hacking the aggregator module?

If I must I guess I will make changes in the aggregator module, but I would rather just work in the theme fucntions.

thanks

Who wrote the CSS for this page? http://drupal.org/project/releases

I am trying figure out how the tabs were done. It's absolutely beautiful and I have ton of questions.

For example, here:

ul.primary li {
display: block;
float: left;
_width: 1px;
height: 20px;
margin: 0px;
padding: 0px;
position: relative;
top: 2px; /* fudgyness to make tabs stay put on text resizing */
_top: 6px;

What does "fudgyness" mean?

And what does the _ right before width: 1px; do?

css customized div tags: better as part of theme or as modules?

I've been customizing the chameleon theme (cvs) for a while now but would ask for some input. One of my goals is to introduce custom css styles that are able to be controlled via the theme admin interface. Right now I've got specific formatting for node types and date down. I use it on the site http://coacalina.org. Basically when nodes are output there is a corresponding div tag based on it's type and it's 'freshness' - if it's a week, two, three, or six weeks old. For example a new page would have this tag:

<div class="fresh page entry">
<h2>page title</h2>
<p>this is the page i created</p>
</div>

The 'fresh' is a new post, the 'page' is the node type, and the 'entry' is a default setting that all nodes fall under. 'Entry' is good because if nothing else is specified then it goes to a default style, otherwise it's overridden by 'fresh' and 'page'. On coacalina.org different freshness settings change the background transparent gif so that older posts are darker than newer ones. Since it's an overall style for the contained information anything within could be specified with a corresponding css style, ie- links could be red for new links, grey for older ones, different backgrounds could be employed. So 'fresh' pages is different from 'ripe' page, and fresh 'page' is different from fresh 'story.

This whole time I've been used to thinking of it as a theme thing, that is - something that would be specific to the theme/engine but as I read more about theme hooks and look at how other themes are created I am wondering,is it more useful as a module? I would like it to be useful to the most drupal users and by limiting it to a theme or engine it's already limited.

Ultimately I'd like to accomplish the style by user, style by section, style by date issues so that people can customize different places on their website but use the same drupal installation. I'd like to have toggles in an administration setting (either in the theme or in a module) to turn on or off a div tag. For example you could go to settings and check 'generate node type tag' and it would add the appropriate text to the div tag. Obviously it would be up to the admin to add the appropriate css information as drupal does not (as of yet) have the ability to create .css files.

So back to the question: Could this be done with a module or can the appropriate div tag info only be created for a specific theme?

here's some code for what i've done:

<?
//  i added a small section to the beginning...
//  this is a measure of how many weeks old something is.
$week_made = date("W",$node->created);
$current_week = date("W");
$content_type = $node->type;
$comment_freshness = date("W",$node->changed);

if($current_week == $week_made) $freshness  .= "fresh";

elseif($current_week - 1 == $week_made) $freshness  .= "recent";
elseif($current_week - 2 == $week_made) $freshness  .= "ripe";
elseif($current_week - 3 == $week_made) $freshness  .= "aged";
elseif($current_week - 6 <= $week_made) $freshness  .= "old";
elseif ($current_week >= $week_made) $freshness  = "old";
//end freshness
?>

Pages

Subscribe with RSS Subscribe to RSS - Theme development