Reproduce:

1. Open Content types -> Recipe -> Display -> Teaser. Set Ingredients and Description to visible
2. Add any taxonomy field to recipe content type.
3. Add node with taxonomy term specified.
4. Open taxonomy term page.

Bug:

Ingredients and Description fields are not shown in the node item in the node list. Generally, any Recipe module related fields not shown, only fields I add by myself.

Expected:

Recipe related fields should be visible in the node teaser mode.

Comments

kn8’s picture

Subscribing

Can't get to render description or any other built-in recipe field in teaser mode. $content variable is completely missing those fields even though they are set to be shown in recipe teaser setting.

For people with similar problem, I found a dirty solution to get around this: load the full node to other variable and render it. It results in loading a full node on every one of the teasers, so it's not really optimal.

$tmp_node=node_load($node->nid);
print render($tmp_node->recipe_description);
Cray Flatline’s picture

I'm using next snippet to get ingredients list :

<?php
	$ingredients = recipe_load_ingredients($node->nid);
	$unit_list = recipe_get_units();
	foreach ($ingredients as $ingredient) {
		print $ingredient['name'] . ' ' . $ingredient['quantity'] . ' ' . t($unit_list[$ingredient['unit_key']]['abbreviation']) . '<br />';
	}
?>

By the way I've got recipe description in the teaser mode (node--recipe.tpl.php) without node load simply with

<?php
			print($node->recipe_description);
?>

May be it helps you.

P.s.: JFYI. As I said in another post, you can get yield form with

<?php print drupal_render(drupal_get_form('recipe_yield_form', $node, true)); ?>
Cynthia Ewer’s picture

Subscribing.

Same problem--and don't seem to be able to get the needed description by the listed edits to node-recipe.tpl.php

dcam’s picture

Status: Active » Closed (duplicate)