I made a few minor changes to the module so that the categories (taxonomy) list could be more easily themed (much like other modules do), in that I changed it to produce a DL instead of a UL. It's pretty easy, but I could post the changes if anyone wants to see them.

I'd love to see this integrated into the 5.x version.

Comments

marble’s picture

Are you talking about the <ul> in the theme_recipe_list function? I believe the theme_ functions can be overridden in users themes, so such a change wouldn't have to go into the official version (don't forget that such a change would affect the way people's current themes work, if they upgraded). If you've found a place where html is generated that isn't in a theme_ function though, that's something that we should fix.

Thanks.

nancydru’s picture

Many, if not most, other modules create a DL for lists like this so that the user can use CSS to compact the list.

Yes, I made this change:

function theme_recipe_list(&$output) {
  if ($output != '') {
    return "<dl>". $output ."</dl>\n";
  }
  return '';
}

and:

function theme_recipe_index_item(&$term) {
  $description = ($term->description != '') ? "<dd class=\"recipe-desc\">". $term->description ."</dd>" : '';
  if ($term->count > 0) {
    return "<dt class=\"recipe-title\">". l($term->name ." ($term->count)", $term->link) ."</dt>". $description.$term->children ."</dd>";
  }
  else {
    return "<dt class=\"recipe-title\">". $term->name ." ($term->count)</dt>". $description.$term->children ."</dd>";
  }
}

This then allowed me to go into the CSS and:

/************** .recipe styles *****************/
/* .recipe-title {background-color:#FFF8DC; width:140px; float:left;
    margin-top: 8px; padding: 0px;}
	
.recipe-desc {margin-left:10px; position:relative;} */
.recipe-title {margin:0; padding:12px 3px; width: 140px; background-color:#FFF8DC; 
    border-bottom: 1px solid white; float:left;}
.recipe-desc {margin: 0 0 0 150px; padding:12px 3px; border-bottom: 1px dotted #d9d9ff;}

This puts the description on the same line and highlights the category.

nancydru’s picture

nancydru’s picture

What's the status of this one?

marble’s picture

Status: Active » Closed (works as designed)

http://drupal.org/node/55126 describes how to override the theme_ functions in your themes. As it is a change to the generated html, in a function that's designed to be overridden so that the generated html can be controlled, I think it shouldn't go into the main module, but into your theme.

nancydru’s picture

Version: 4.7.x-1.0 » 5.x-1.x-dev

And how many of the 16 themes I currently use should I modify? I don't modify themes because it gives that much more maintenance that my customers rightly don't see a need to pay for. I'd much rather see the change in one place where it is easier to handle. And I only have 3 CSS sets that get copied into those 16 themes.

marble’s picture

My problem is that by putting this into the module, it then changes for everyone else. If other users have set up their themes based on the HTML that is generated currently, then they update to get a bugfix or something and find it suddenly breaks their layout.

If you have so many themes, then you are welcome to maintain your own modified version. I realise that's a pain for you, and I apologise for that. On the bright side, the recipe module doesn't release new versions very often.