Last active
November 22, 2017 14:40
-
-
Save calvez/61a89c396d94b5587cc46101242bc10e to your computer and use it in GitHub Desktop.
drupal theme hooks for bdo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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