Error message

User warning: The following theme is missing from the file system: responsive_green. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1143 of /var/www/moscovie.com/includes/bootstrap.inc).

Меняем стиль у картинок програмно

function xxx_node_view($node, $view_mode, $langcode)
{
if($view_mode == "full" && $node->type == "article")
{

$filepath = $node->field_name_image[LANGUAGE_NONE][0]['uri'];
$node->content['image1'] = array
(
'#theme' => 'image_style',
'#style_name' => 'thumbnail',
'#path' => $filepath,
);
$node->content['field_image'] = array
(
'#theme' => 'image_style',
'#style_name' => 'medium',
'#path' => $filepath,
);
}

// Note: If using PHP 5.2.X, uncomment this line:
// return $node;
}

Категория: 
The code has been tested and works
Мультитег: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.