本文整理汇总了PHP中views_embed_view函数的典型用法代码示例。如果您正苦于以下问题:PHP views_embed_view函数的具体用法?PHP views_embed_view怎么用?PHP views_embed_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了views_embed_view函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewElements
/**
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = [];
foreach ($items as $delta => $item) {
$view_name = $item->getValue()['target_id'];
$display_id = $item->getValue()['display_id'];
$argument = $item->getValue()['argument'];
if ($argument != '') {
$view = views_embed_view($view_name, $display_id, $argument);
}
else {
$view = views_embed_view($view_name, $display_id);
}
if ($this->getSetting('render_view')) {
$elements[$delta] = array(
'#markup' => render($view),
// todo what cache shall we use?
'#cache' => array(
// 'tags' => $user->getCacheTags(),
),
);
}
}
return $elements;
}
示例2: er_browser_widget_search_content
function er_browser_widget_search_content(array &$form, FormStateInterface $form_state)
{
$form = \Drupal::formBuilder()->getForm('Drupal\\er_browser_widget\\Form\\EntityReferenceBrowserWidgetForm');
$response = new AjaxResponse();
$title = $this->t('Entity Search and Reference.');
$form['#attached']['library'][] = 'core/drupal.dialog.ajax';
$response->setAttachments($form['#attached']);
$content = views_embed_view('entity_reference_browser_widget');
$options = array('dialogClass' => 'test-dialog', 'width' => '75%');
$modal = new OpenModalDialogCommand($title, $form, $options);
$response->addCommand($modal);
return $response;
}
示例3: phptemplate_preprocess_page
/**
* Override or insert PHPTemplate variables into the templates.
*/
function phptemplate_preprocess_page(&$vars)
{
// print_r($vars);
$vars['primary_links'] = _opensourcery_primary_links($vars['primary_links']);
$vars['secondary_links'] = _opensourcery_secondary_links($vars['secondary_links']);
$vars['tabs2'] = menu_secondary_local_tasks();
// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
// Render the slideshow view for homepage
$vars['embedded_slideshow'] = views_embed_view('homeslideshow', 'block_1');
//Reload the javascript into the scripts due to a problem with slideshow.
$vars['scripts'] = drupal_get_js();
}
示例4: mailer
/**
* Mailer.
*/
public function mailer(Request $request)
{
$content = $request->getContent();
if (empty($content)) {
return new JsonResponse(['status' => 'error']);
}
$params = Json::decode($content);
$email = $params['email'];
$result = $params['selection'];
$progress = $params['progress'];
// Handle errors.
if (!valid_email_address($email) || strlen($result) < 2) {
return new JsonResponse(['status' => 'error']);
}
// Prepare email.
$to = [$email];
$view = views_embed_view('answer', 'rest_export_1', $result);
$content = \Drupal::service('renderer')->render($view);
$nodes = Json::decode($content);
// Get the hidden fields
$view = views_embed_view('hideanswers', 'rest_export_1', $result);
$content = \Drupal::service('renderer')->render($view);
$hidden = Json::decode($content);
$hidden = array_map(function ($item) {
return $item['nid'];
}, $hidden);
$view = views_embed_view('disclaimer', 'rest_export_1', $result);
$content = \Drupal::service('renderer')->render($view);
$disclaimer = Json::decode($content);
$view = views_embed_view('intro_email', 'rest_export_1', $result);
$content = \Drupal::service('renderer')->render($view);
$intro = Json::decode($content);
$result = \Drupal::service('plugin.manager.mail')->mail('angapp', 'results', implode(', ', $to), \Drupal::currentUser()->getPreferredLangcode(), ['progress' => $progress, 'intro' => $intro, 'disclaimer' => $disclaimer, 'nodes' => $nodes, 'hidden' => $hidden]);
if ($result['result'] === TRUE) {
return new JsonResponse(['status' => 'ok']);
} else {
return new JsonResponse(['status' => 'error']);
}
}
示例5: run
function run()
{
// get html from view by setting_name
$setting = $_REQUEST['name'];
// get settings from civicrm
$settings = CRM_Core_BAO_Setting::getItem('windowsill', 'settings');
$decode = json_decode(utf8_decode($settings), true);
// variables
$error = TRUE;
$content = "";
$view = array();
// loop settings
foreach ($decode as &$value) {
// get view data if setting exists
if ($setting == $value['name']) {
$error = FALSE;
$view = explode(':', $value['view']);
break;
}
}
// check if setting exists & set page variables
if (!$error) {
$title = $setting;
$content .= views_embed_view($view[0], $view[1]) . "<br>";
} else {
$title = "Configuration error";
$content .= "Check your windowsill settings.";
}
// assign page title
CRM_Utils_System::setTitle(ts('WindowSill Render'));
// assign a variable for use in a template
$this->assign('title', $title);
$this->assign('content', $content);
// render
parent::run();
}
示例6: views_embed_view
<?php
echo views_embed_view('top_news_first', 'default', $output) . views_embed_view('news_tabs_right_side', 'default', $output);
开发者ID:MKM-ITAO,项目名称:riigiteenused_kood,代码行数:3,代码来源:views-view-field--top-news-tabs--block--tid.tpl.php
示例7: arg
<?php
//$block = module_invoke('views', 'block_view', 'destinos-block_1');
//print render($block['content']);
//Block Productos (Destinos)
$tid = arg(2);
$term = taxonomy_term_load($tid);
$my_arg = $term->name;
$block = views_embed_view('destinos', 'block_1', $my_arg);
print '<h3 class="lined" style="margin-top: 12px">' . t('Viajes por ') . $my_arg . '</h3>';
if (!empty($block)) {
print $block;
} else {
print t('No se encontraron viajes en ') . $my_arg;
}
//Block Restaurantes (Destinos)
$block_restaurantes = views_embed_view('restaurantes', 'block', $my_arg);
print '<h3 class="lined" style="margin-top: 12px">' . t('Restaurantes por ') . $my_arg . '</h3>';
if (!empty($block_restaurantes)) {
print $block_restaurantes;
} else {
print t('No se encontraron restaurantes en ') . $my_arg;
}
//Block Hoteles (Destinos)
$block_hoteles = views_embed_view('hotels', 'block', $my_arg);
print '<h3 class="lined" style="margin-top: 12px">' . t('Hoteles por ') . $my_arg . '</h3>';
if (!empty($block_hoteles)) {
print $block_hoteles;
} else {
print t('No se encontraron restaurantes en ') . $my_arg;
}
示例8: views_embed_view
<div class="panel panel-carousel slide">
<div class="panel-heading">
<h3 class="panel-title"><a href="/business-news">Business News</a></h3>
</div>
<?php
print views_embed_view('front_page_news_views', 'business_news');
?>
</div>
<div class="panel panel-carousel slide">
<div class="panel-heading">
<h3 class="panel-title"><a href="/whats-new">What's New</a></h3>
</div>
<?php
print views_embed_view('front_page_news_views', 'whats_new');
?>
</div>
<div class="panel panel-carousel slide">
<div class="panel-heading">
<h3 class="panel-title"><a href="/quick-facts">Quick Facts</a></h3>
</div>
<?php
print views_embed_view('front_page_news_views', 'quick_facts');
?>
</div>
</div>
</div>
</div>
</div>
示例9: views_embed_view
?>
' class="email" target="_blank" title="Email this content"><img src="/sites/all/themes/mortgage_new_theme/images/mail1.png" /></a>
</span>
<span class="chicklets copy-to-clipboard">
<textarea class="js-copytextarea" id="copytext_<?php
print $nid;
?>
"><?php
print $url1;
?>
</textarea>
<a href="javascript:void(0)" class="copy-link js-textareacopybtn" title="Copy link to clipboard" onclick="customCopyText('copytext_<?php
print $nid;
?>
');">Copy Textarea</a>
</span>
</div>
<!-- Flag link-->
<?php
print $flag_link;
?>
</span>
</div>
<div class="views-popup-container"><?php
print views_embed_view('popup_views', 'block_1', $nid);
?>
</div>
</div>
<?php
}
开发者ID:snehal-addweb,项目名称:Mortgagespeak,代码行数:31,代码来源:views-view-unformatted--company-view-detail--page.tpl.php
示例10: hide
?>
</div>
<?php endif;?>
<div id="js-contentFilterContainer"></div>
<?php
hide($content['comments']);
hide($content['links']);
hide($content['field_tags']);
?>
<?php print render($content); ?>
<div class="linkedContent view-recent-activity">
<?php print views_embed_view('relations_to_nodes', 'parents'); ?>
<?php print views_embed_view('relations_to_nodes', 'evidence'); ?>
<?php print views_embed_view('relations_to_nodes', 'relationteaser'); ?>
</div>
<?php if (user_is_logged_in()): ?>
<div class="linkingForm"><?php print render($select_relation) ?></div>
<?php endif; ?>
<?php if ((user_is_logged_in() == FALSE) && ($open_to_comments == TRUE)): ?>
<div id='comment-form-container'><figure class='loginToCommentCTA'>
<h2 class='title comment-form'><?php print $comment_login_title ?></h2>
<span class='form-item'>
<label><?php print $comment_login_subject ?> </label><input class='form-control form-text' type='text' size='60'>
</span>
<span>
<span class='form-item'>
<label><?php print $comment_login_comment ?>
<span class='form-required'>*</span>
示例11: page
/**
* Page callback: sample Views-based report.
*
* @see zeitgeist_preprocess_views_view()
*
* @return string
* HTML
*/
public function page()
{
$ret = views_embed_view('zeitgeist');
return $ret;
}
示例12: views_embed_view
$right_data = $large;
$left_data = views_embed_view('articles_view', 'vertical');
}
}
?>
<div class="major-blog_right">
<div class="<?php
print $r_css;
?>
blog_margin">
<?php
print $right_data;
?>
</div>
<div class="<?php
print $l_css;
?>
">
<?php
print $left_data;
?>
</div>
<div style="display: inline-block;">
<?php
print views_embed_view('articles_view', 'small');
?>
</div>
</div>
示例13: views_embed_view
?>
<div class="schools-wrapper">
<?php
print views_embed_view('instructors', 'instructors_schools_block', substr($relatedNodes['instructor'], 0, -1));
?>
</div>
<?php
}
?>
<?php
if ($relatedNodes['news']) {
?>
<div class="news-wrapper">
<?php
print views_embed_view('news', 'news_block', substr($relatedNodes['news'], 0, -1));
?>
</div>
<?php
}
?>
<?php
print render($content['links']);
?>
<?php
print render($content['comments']);
?>
</article>
示例14: render
Tlf. 43 57 75 75</p>
<p><a href="mailto:ishojkommune@ishoj.dk" title="Skriv e-mail til Ishøj Kommune">ishojkommune@ishoj.dk</a></p>
</div>
<div class="grid-third sociale-medier">
<?php
print render($page['footer_sociale']);
?>
<h3>Følg os på sociale medier</h3>
<p>
<a class="sprite sprite-facebook footer" href="http://www.facebook.com/ishojkommune" title="Følg Ishøj Kommune på Facebook"><span><span class="screen-reader">Følg Ishøj Kommune på Facebook</span></span></a>
<a class="sprite sprite-linkedin footer" href="https://www.linkedin.com/company/ishoj-kommune" title="Følg Ishøj Kommune på LinkedIn"><span><span class="screen-reader">Følg Ishøj Kommune på LinkedIn</span></span></a>
<a class="sprite sprite-twitter footer" href="http://www.twitter.com/ishojkommune" title="Følg Ishøj Kommune på Twitter"><span><span class="screen-reader">Følg Ishøj Kommune på Twitter</span></span></a>
<a class="sprite sprite-youtube footer" href="http://www.youtube.com/tvishoj" title="Følg Ishøj Kommune på Youtube"><span><span class="screen-reader">Følg Ishøj Kommune på Youtube</span></span></a>
</p>
</div>
</div>
</div>
</footer>
<!-- FOOTER SLUT-->
<?php
// BREAKING
print views_embed_view('kriseinformation', 'pagevisning');
?>
</div>
<!-- PAGE SLUT -->
示例15: views_embed_view
<?php
// $Id: node.tpl.php,v 1.4 2007/08/07 08:39:36 goba Exp $
?>
<div id="event-title">
<h1><?php
print $node->title;
?>
</h1>
</div>
<div id="event-share">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4ddd07af51706810"></script>
<!-- AddThis Button END -->
</div>
<div id="category-wrapper"><?php
print views_embed_view('mainstage', 'page_1', $node->field_category_name[0]['value']);
?>
</div>