Skip to content

Instantly share code, notes, and snippets.

@iledcom
Created August 10, 2015 11:14
Show Gist options
  • Save iledcom/4002109bbb4bef58c203 to your computer and use it in GitHub Desktop.
Save iledcom/4002109bbb4bef58c203 to your computer and use it in GitHub Desktop.
Drupal7 taxonomy_term_load_multiple
<?php
$tids = array(0);
$terms = taxonomy_term_load_multiple($tids);
foreach ($terms as $term) {
$name = $term->name;
$description = $term->description;
$nik = field_get_items('taxonomy_term', $term, 'field_nik');
$nikname = field_view_value('taxonomy_term', $term, 'field_nik', $nik[0], array(
'type' => 'text',
));
$teas = field_get_items('taxonomy_term', $term, 'field_teaser');
$teaser = field_view_value('taxonomy_term', $term, 'field_teaser', $teas[0], array(
'type' => 'text',
));
$image = field_get_items('taxonomy_term', $term, 'field_image');
$img = field_view_value('taxonomy_term', $term, 'field_image', $image[0], array(
'type' => 'image',
'settings' => array(
'image_style' => 'medium',
)
));
$image = field_get_items('taxonomy_term', $term, 'field_image');
$imglg = field_view_value('taxonomy_term', $term, 'field_image', $image[0], array(
'type' => 'image',
'settings' => array(
'image_style' => 'large',
)
));
?>
<div id="vitrina_grid">
<div class="mix col-md-3 col-sm-6 col-xs-6 vitrina_item <?php print render($nikname);?>">
<?php print render($img);?>
<div class="port_item_cont">
<h3><?php print $name;?></h3>
<p><?php print render($teaser);?></p>
<a href="#" class="popup_content">Посмотреть</a>
</div>
<div class="hidden">
<div class="podrt_descr">
<div class="modal-box-content">
<button class="mfp-close" type="button" title="Close (Esc)">×</button>
<h3><?php print $name;?></h3>
<p><?php print $description;?></p>
<?php print render($imglg);?>
</div>
</div>
</div>
</div>
<?php } ?>
<?php
$nids = array(48);
$nodes = node_load_multiple($nids);
foreach ($nodes as $node) {
$title = $node->title;
print $title;
}
//$image = field_get_items('node', $node, 'field_image');
//$output = field_view_value('node', $node, 'field_image', $image[0], array(
// 'type' => 'image',
// 'settings' => array(
// 'image_style' => 'thumbnail',
// 'image_link' => 'content',
// ),
//));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment