当前位置: 首页>>代码示例>>PHP>>正文


PHP field_view_value函数代码示例

本文整理汇总了PHP中field_view_value函数的典型用法代码示例。如果您正苦于以下问题:PHP field_view_value函数的具体用法?PHP field_view_value怎么用?PHP field_view_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了field_view_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: noreg_preprocess_node__sale_ad

function noreg_preprocess_node__sale_ad(&$variables)
{
    // All node types but page
    if ($variables['elements']['#view_mode'] != 'page') {
        // Litter
        if ($field_litter = field_get_items('node', $variables['node'], 'field_litter_id')) {
            $node_litter = node_load($field_litter[0]['target_id']);
            // Birthdate
            if ($field_litter_birthdate = field_get_items('node', $node_litter, 'field_birthdate')) {
                $variables['litter_birthdate'] = field_view_value('node', $node_litter, 'field_birthdate', $field_litter_birthdate[0], array('settings' => array('format_type' => 'custom_short')));
            }
            // Price per young
            if ($field_litter_price_per_young = field_get_items('node', $node_litter, 'field_price_per_young')) {
                $variables['litter_price_per_young'] = field_view_value('node', $node_litter, 'field_price_per_young', $field_litter_price_per_young[0]);
            }
            // Animal
            if ($field_animal = field_get_items('node', $node_litter, 'field_animal_id')) {
                $node_animal = node_load($field_animal[0]['target_id']);
                // Breed
                if ($field_breed = field_get_items('node', $node_animal, 'field_breed_id')) {
                    $variables['animal_breed'] = field_view_value('node', $node_animal, 'field_breed_id', $field_breed[0]);
                }
            }
        }
        // User
        if ($node_creator = ha_user_get_raw_information($variables['user']->uid)) {
            // Location
            if (isset($node_creator['location'])) {
                $variables['user_location'] = $node_creator['location'];
            }
        }
    }
}
开发者ID:bellcom,项目名称:noreg,代码行数:33,代码来源:template.php

示例2: field_view_values

 public function field_view_values($entity_type, $entity, $field_name, $display = array(), $langcode = NULL)
 {
     $items = field_get_items($entity_type, $entity, $field_name);
     if ($items) {
         $output = array();
         foreach ($items as $item) {
             $output[] = field_view_value($entity_type, $entity, $field_name, $item, $display, $langcode);
         }
         return $output;
     }
 }
开发者ID:bangpound,项目名称:drupal-bundle,代码行数:11,代码来源:RenderExtension.php

示例3: ssd_preprocess_node

function ssd_preprocess_node(&$variables)
{
    $node = $variables['node'];
    $variables['title'] = check_plain($node->title);
    if ($node->type == 'article') {
        // Get only the first body summary for a module.
        $body = field_get_items('node', $node, 'body');
        $variables['summary'] = field_view_value('node', $node, 'body', $body[0], 'teaser');
        $variables['metadata'] = field_view_field('node', $node, 'field_metadata', 'default');
    }
}
开发者ID:seefood,项目名称:ssd,代码行数:11,代码来源:template.php

示例4: venture_theme_preprocess_page

/**
 * Override or insert variables into the page template.
 */
function venture_theme_preprocess_page(&$vars)
{
    if (drupal_is_front_page()) {
        $vars['images'] = array();
        $query = db_select('node', 'n')->fields('n', array('nid'))->condition('type', 'slider_item', '=')->range(0, 3)->execute();
        $view = $query->fetchAssoc();
        foreach ($view as $item) {
            $node = node_load($item);
            $image_field = field_get_items('node', $node, 'field_image');
            $image = field_view_value('node', $node, 'field_image', $image_field[0], array('type' => 'image', 'settings' => array('image_style' => 'slider_item', 'image_link' => NULL)));
            $vars['images'][] = $image;
        }
    }
    if (isset($vars['main_menu'])) {
        $vars['main_menu'] = theme('links__system_main_menu', array('links' => $vars['main_menu'], 'attributes' => array('class' => array('links', 'main-menu', 'clearfix')), 'heading' => array('text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
    } else {
        $vars['main_menu'] = FALSE;
    }
    if (isset($vars['secondary_menu'])) {
        $vars['secondary_menu'] = theme('links__system_secondary_menu', array('links' => $vars['secondary_menu'], 'attributes' => array('class' => array('links', 'secondary-menu', 'clearfix')), 'heading' => array('text' => t('Secondary menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
    } else {
        $vars['secondary_menu'] = FALSE;
    }
}
开发者ID:AVE303,项目名称:janenjoost,代码行数:27,代码来源:template.php

示例5: field_get_items

<?php

$alignment = field_get_items('paragraphs_item', $paragraphs_item, 'field_alignment');
$alignment = empty($alignment[0]['value']) ? 'center' : $alignment[0]['value'];
$heading = field_get_items('paragraphs_item', $paragraphs_item, 'field_heading');
$heading = empty($heading[0]['value']) ? '' : $heading[0]['value'];
$subheading = field_get_items('paragraphs_item', $paragraphs_item, 'field_subheading');
$subheading = empty($subheading[0]['value']) ? '' : $subheading[0]['value'];
$text = field_get_items('paragraphs_item', $paragraphs_item, 'field_text');
$text = empty($text[0]['value']) ? '' : $text[0]['value'];
$image = field_get_items('paragraphs_item', $paragraphs_item, 'field_image');
$image_renderable = field_view_value('paragraphs_item', $paragraphs_item, 'field_image', $image[0]);
?>

<?php 
if ($alignment == "center") {
    ?>
<div class="row">
<div class="col-sm-12 center-text">
<?php 
    print render($image_renderable);
    ?>
</div>
</div>

<div class="row">
<div class="col-sm-12 center-text">


<?php 
    if ($heading) {
开发者ID:Stony-Brook-University,项目名称:doitsbu,代码行数:31,代码来源:paragraphs-item--image-feature.tpl.php

示例6: field_get_items

            <?php 
}
?>
            <h5>
                <?php 
if (!empty($field_external_author)) {
    ?>
                    <span style="margin-right:3px;">By:</span>
                    <?php 
    $field = field_get_items('node', $node, 'field_external_author');
    print render(field_view_value('node', $node, 'field_external_author', $field[0]));
    ?>
                <?php 
}
?>
            </h5>

            <?php 
print render($content['body']);
?>

            <a href="<?php 
$field = field_get_items('node', $node, 'field_external_url');
print render(field_view_value('node', $node, 'field_external_url', $field[0]));
?>
" target="_blank">Read Original Article</a>
        </div>
    </div>

</article> <!-- /.node -->
开发者ID:akhattab-klipfolio,项目名称:Drupal-Git,代码行数:30,代码来源:node--coverage.tpl.php

示例7: node_load

 * - $css_name: A css-safe version of the view name.
 * - $css_class: The user-specified classes names, if any
 * - $header: The view header
 * - $footer: The view footer
 * - $rows: The results of the view query, if any
 * - $empty: The empty text to display if the view is empty
 * - $pager: The pager next/prev links to display, if any
 * - $exposed: Exposed widget form/info to display
 * - $feed_icon: Feed icon to display, if any
 * - $more: A link to view more, if any
 *
 * @ingroup views_templates
 */
$node = node_load($view->result[0]->nid);
$image = field_get_items('node', $node, 'field_block_image');
$body = field_get_items('node', $node, 'body');
?>
<div class="row block-wrapper">
    <div class="large-7 columns body">
        <?php 
print render(field_view_value('node', $node, 'body', $body[0], array('label' => 'hidden')));
?>
    </div>
    <div class="large-5 columns image large-text-left medium-text-center small-text-center">
        <?php 
print render(field_view_value('node', $node, 'field_block_image', $image[0]));
?>
    </div>
</div>
<div class="clearfix"></div>
开发者ID:rmyrup,项目名称:grameen-foundation,代码行数:30,代码来源:views-view--cm-home-subscribe.tpl.php

示例8: loop_preprocess_comment

/**
 * Implements hook_preprocess_comment().
 *
 * Load user for every comment.
 */
function loop_preprocess_comment(&$variables)
{
    // Make the content author object available.
    $variables['comment']->account = user_load($variables['comment']->uid);
    $variables['comment_author_name'] = _loop_fetch_full_name($variables['comment']->account);
    $variables['comment_author_image'] = _loop_fetch_author_image($variables['comment']->account);
    $variables['comment_body'] = _loop_fetch_comment_body($variables['comment']);
    $comment_author = $variables['comment']->account;
    if (is_object($comment_author)) {
        // Load entity wrapper for author.
        $wrapper = entity_metadata_wrapper('user', $comment_author);
        // Fetch the fields needed.
        $variables['place'] = $wrapper->field_location_place->value();
        $fetched_job_title = field_get_items('user', $variables['comment']->account, 'field_job_title');
        $variables['job_title'] = field_view_value('user', $variables['comment']->account, 'field_job_title', $fetched_job_title[0], array());
    }
    // Fetch files related to the comment.
    if ($variables['node']->type == 'post') {
        if (!empty($variables['field_file_upload_comment'])) {
            $variables['files'] = _loop_fetch_files('comment', $variables['comment']);
        }
    }
    $variables['content']['links']['abuse']['#attributes']['class'] = 'comment--links';
    // Remove flag, delete, edit and reply links.
    unset($variables['content']['links']['comment']['#links']['comment-delete']);
    unset($variables['content']['links']['comment']['#links']['comment-edit']);
    unset($variables['content']['links']['flag']);
    unset($variables['content']['links']['comment']['#links']['comment-reply']);
}
开发者ID:faxe-kommune,项目名称:OS2loop,代码行数:34,代码来源:template.php

示例9: unity_lab_it_preprocess_node_software_title

function unity_lab_it_preprocess_node_software_title(&$vars, $hook)
{
    $relatedNodeIds = $vars['field_computer_lab_nodes'];
    $nodeIds = array();
    foreach ($relatedNodeIds as $relatedNodeId) {
        $nodeIds[] = $relatedNodeId['target_id'];
    }
    if (count($nodeIds) > 0) {
        $relatedNodes = entity_load('node', $nodeIds);
        $items = array();
        foreach ($relatedNodes as $relatedNode) {
            $logo = field_get_items('node', $relatedNode, 'field_logo');
            if ($logo) {
                $logo_render = field_view_value('node', $relatedNode, 'field_logo', $logo[0]);
                //$logo_render['#item']["attributes"]["class"] = array('flat-circle-image');
                $item['image'] = $logo_render;
            } else {
                $item['image'] = '';
            }
            $item['url'] = url('node/' . $relatedNode->nid);
            $item['title'] = $relatedNode->title;
            $rnIntroduction = field_get_items('node', $relatedNode, 'field_introduction');
            $rnIntroduction = empty($rnIntroduction[0]['value']) ? '' : $rnIntroduction[0]['value'];
            $item['introduction'] = $rnIntroduction;
            $vars['content']['labs'][] = $item;
        }
    }
    _unity_lab_paragraphs_item_column_classes($vars, $vars['content']['labs'], 1);
    $view = views_get_view('related_kb_articles');
    $output = $view->preview('block_3');
    // At least in $view->result is the result.
    if ($view->result) {
        $vars['content']['faqView'] = $output;
    }
    if (arg(0) == 'node' && is_numeric(arg(1))) {
        // creating the node variable
        $node = node_load(arg(1), NULL, TRUE);
    }
    $reportProbURL = field_get_items('node', $node, 'field_report_a_problem_url');
    $reportProbURL = empty($reportProbURL[0]['url']) ? '' : $reportProbURL[0]['url'];
    if ($reportProbURL) {
        $vars['content']['reportProbURL'] = $reportProbURL;
    }
}
开发者ID:Stony-Brook-University,项目名称:doitsbu,代码行数:44,代码来源:template.php

示例10: field_get_items

        <div class="col-lg-7">
          <?php 
    $item = field_get_items('node', $node, 'body');
    $body = field_view_value('node', $node, 'body', $item[0]);
    print $body['#markup'];
    ?>
        </div>
    </div>
  <?php 
} else {
    ?>
    <div class="row">
        <div class="col-lg-12">
          <?php 
    $item = field_get_items('node', $node, 'body');
    $body = field_view_value('node', $node, 'body', $item[0]);
    print $body['#markup'];
    ?>
        </div>
    </div>
  <?php 
}
?>
  <?php 
// Hide comments, tags, and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['field_tags']);
?>
  <?php 
if (!empty($content['field_tags']) || !empty($content['links'])) {
开发者ID:verbruggenalex,项目名称:mediayoutubeupload,代码行数:31,代码来源:node--page--teaser.tpl.php

示例11: field_get_items

                        
                         <h2><b>Related Publications</b></h2>
                        <div>
                        <?php 
$field_store_reference = field_get_items('node', $node, 'field_docum_related_publications');
$render_array = field_view_value('node', $node, 'field_docum_related_publications', $field_store_reference[0]);
echo "<br>";
print render($render_array);
?>

                        </div>
                         <h2><b>Related Documents and Media</b></h2>
                        <div>
<?php 
$field_store_reference = field_get_items('node', $node, 'field_docum_related_publications');
$render_array = field_view_value('node', $node, 'field_docum_related_publications', $field_store_reference[0]);
echo "<br>";
print render($render_array);
?>

                        </div>
                        
                        <div class="des-bottom">
<b>Research Topics:</b> 
<?php 
//   print render(field_view_field('node', $node, 'field_document_rits'));
?>
<br>
<b>National Strategic Program Areas:</b> Wildland Fire and Fuels<br>
<b>Priority Research Area: </b> Sxxxxxxxxxxxxx<br>
<b>PNW Research Programs: </b>
开发者ID:phpsubbarao,项目名称:test-core,代码行数:30,代码来源:page--documents.tpl.php

示例12: render

     }
     ?>
                 <?php 
 }
 ?>
                 <?php 
 if (isset($content['sharethis'])) {
     ?>
                     <?php 
     print render($content['sharethis']);
     ?>
                 <?php 
 }
 ?>
             </div>
             <div class="w-col w-col-8">
                 <?php 
 foreach ($multimedia as $key => $value) {
     $pid = $value['value'];
     $data = field_view_value('node', $node, 'field_portfolio_multimedia', $multimedia[$key]);
     ?>
                     
                         
                             <?php 
     print render($data['entity']['field_collection_item'][$pid]['field_portfolio_multi_image']);
     ?>
                         
                 <?php 
 }
 ?>
             </div>
开发者ID:toptomatotwo,项目名称:tomwebdev,代码行数:31,代码来源:node--portfolio.tpl_orig.xxx.php

示例13: field_get_items

<?php

$image = '';
if (!empty($node->field_video)) {
    $field_video = field_get_items('node', $node, 'field_video');
    $field_custom_video_thumbnail = field_get_items('node', $node, 'field_custom_video_thumbnail');
    if (!empty($field_custom_video_thumbnail[0]['uri'])) {
        $image_item = array('style_name' => $thumb_image_style, 'path' => $field_custom_video_thumbnail[0]['uri'], 'alt' => $node->title, 'title' => $node->title);
        $image = theme('image_style', $image_item);
    } else {
        $field_video_view_value = field_view_value('node', $node, 'field_video', $field_video[0]);
        $field_video_view_value['#theme'] = 'video_formatter_thumbnail';
        $field_video_view_value['#image_style'] = $thumb_image_style;
        $image = render($field_video_view_value);
    }
}
$node_url = url('node/' . $node->nid);
$name = bizutv_helper_get_user_name($node->uid);
$display_name = l($name, 'user/' . $node->uid);
$duration = bizutv_helper_get_duration($node->field_video['und'][0]['fid']);
$likes_display = '';
if ($likes) {
    $rate_results = rate_get_results('node', $node->nid, 1);
    $likes_display = $rate_results['up'];
}
$views_display = '';
if ($views) {
    $hits = bizutv_video_get_node_hits($node->nid);
    $views_display = $hits . ' view' . ($hits == 1 ? '' : 's');
}
$time_ago_display = '';
开发者ID:johnedelatorre,项目名称:fusion,代码行数:31,代码来源:bizutv-video-thumb.tpl.php

示例14: variable_get

 size-<?php 
print $banner_height_value;
?>
">

    <div class="banner-image" style="<?php 
$files_dir = variable_get('file_public_path', conf_path() . '/files');
if (!empty($field_image)) {
    print 'background-image:url(/' . $files_dir . '/banners/' . $field_image[0]['filename'] . ');';
}
?>
">

        <?php 
if (!empty($field_banner_text)) {
    ?>
            <div class="container label-wrapper">
                <h2>
                    <?php 
    $field = field_get_items('node', $node, 'field_banner_text');
    print render(field_view_value('node', $node, 'field_banner_text', $field[0]));
    ?>
                </h2>
            </div>
        <?php 
}
?>
    </div>

</div>
开发者ID:akhattab-klipfolio,项目名称:Drupal-Git,代码行数:30,代码来源:node--nodeblock--banner-image.tpl.php

示例15: field_get_items

			<?php 
    if (isset($content['field_gallery'])) {
        //
        ?>


				<?php 
        $images = field_get_items('node', $node, 'field_gallery');
        ?>

				<?php 
        $gallery = array();
        if ($images && !$is_front) {
            foreach ($images as $img) {
                $gallery[] = field_view_value('node', $node, 'field_gallery', $img, array('type' => 'image', 'settings' => array('image_style' => 'large')));
            }
            print render($galeria);
        }
        ?>

			<?php 
    }
} else {
    print render($page['content']);
}
?>
    </section>
    
		</div>
		
开发者ID:pedrokoblitz,项目名称:drupal-ascom,代码行数:29,代码来源:page--node.tpl.php


注:本文中的field_view_value函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。