Skip to content

Instantly share code, notes, and snippets.

@calvez
Last active November 22, 2017 14:40
Show Gist options
  • Save calvez/61a89c396d94b5587cc46101242bc10e to your computer and use it in GitHub Desktop.
Save calvez/61a89c396d94b5587cc46101242bc10e to your computer and use it in GitHub Desktop.
drupal theme hooks for bdo
// img snippet
<img src="<?php print file_create_url($node->field_image[LANGUAGE_NONE][0]['uri']); ?>" />
<div class="container-fluid" style="background-image:url('<?php echo file_create_url($node->field_image[LANGUAGE_NONE][0]['uri']);?>');">
// img a coverhez váltoizóval style-t kérve
<?php
$image_uri = $node->field_image[LANGUAGE_NONE][0]['uri']; // or any public://my_image
$style = 'my_style';
$derivative_uri = image_style_path($style, $image_uri);
$success = file_exists($derivative_uri) || image_style_create_derivative(image_style_load($style), $image_uri, $derivative_uri);
$new_image_url = file_create_url($derivative_uri);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment