/** * @Route("/{type}/{subtype}", name="ctools_content_render") * @Method({"GET", "POST"}) * @Template * @param string $type * @param string $subtype * @param array $conf * @param array $keywords * @param array $args * @param array $context * @param string $incoming_content * @throws BadRequestHttpException * @return array */ public function renderAction($type, $subtype, $conf = array(), $keywords = array(), $args = array(), $context = array(), $incoming_content = '') { $block = ctools_content_render($type, $subtype, $conf, $keywords, $args, $context, $incoming_content); if ($block) { return (array) $block; } else { throw new BadRequestHttpException(sprintf('Cannot render ctools content type %s, %s', $type, $subtype)); } }
/** * Implements template_preprocess_page(). */ function oa_radix_preprocess_page(&$vars) { // Rework search_form to our liking. $vars['search_form'] = ''; if (module_exists('search') && user_access('search content')) { $search_box_form = drupal_get_form('search_form'); $search_box_form['basic']['keys']['#title'] = ''; $search_box_form['basic']['keys']['#attributes'] = array('placeholder' => 'Search'); $search_box_form['basic']['keys']['#attributes']['class'][] = 'search-query'; $search_box_form['basic']['submit']['#value'] = t('Search'); $search_box_form['#attributes']['class'][] = 'navbar-form'; $search_box_form['#attributes']['class'][] = 'pull-right'; $search_box = drupal_render($search_box_form); $vars['search_form'] = user_access('search content') ? $search_box : NULL; } // Add user_badge to header. $vars['user_badge'] = ''; if (module_exists('oa_dashboard')) { $user_badge = module_invoke('oa_dashboard', 'block_view', 'oa_user_badge'); $vars['user_badge'] = $user_badge['content']; } $toolbar = panels_mini_block_view('oa_toolbar_panel'); $vars['oa_toolbar_panel'] = isset($toolbar) ? $toolbar['content'] : ''; $footer = panels_mini_block_view('oa_footer_panel'); $vars['oa_footer_panel'] = isset($footer) ? $footer['content'] : ''; ctools_include('content'); $banner = ctools_content_render('oa_space_banner', '', array('banner_position' => 2)); if (!empty($banner->content)) { $vars['oa_banner'] = $banner->content; } $vars['oa_space_menu'] = ''; $space_id = oa_core_get_space_context(); if (variable_get('oa_space_menu_' . $space_id, TRUE)) { $space_menu = ctools_content_render('oa_space_menu', '', array(), array()); if (!empty($space_menu->content)) { $vars['oa_space_menu'] = $space_menu->content; } } }
/** * Render the interior contents of a single pane. * * This method retrieves pane content and produces a ready-to-render content * object. It also manages pane-specific caching. * * @param stdClass $pane * A Panels pane object, as loaded from the database. * @return stdClass $content * A renderable object, containing a subject, content, etc. Based on the * renderable objects used by the block system. */ function render_pane_content(&$pane) { ctools_include('context'); // TODO finally safe to remove this check? if (!is_array($this->display->context)) { watchdog('panels', 'renderer::render_pane_content() hit with a non-array for the context', $this->display, WATCHDOG_DEBUG); $this->display->context = array(); } $content = FALSE; $caching = !empty($pane->cache['method']) && empty($this->display->skip_cache); if ($caching && ($cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context, $pane))) { $content = $cache->content; } else { $content = ctools_content_render($pane->type, $pane->subtype, $pane->configuration, array(), $this->display->args, $this->display->context); foreach (module_implements('panels_pane_content_alter') as $module) { $function = $module . '_panels_pane_content_alter'; $function($content, $pane, $this->display->args, $this->display->context); } if ($caching) { $cache = new panels_cache_object(); $cache->set_content($content); panels_set_cached_content($cache, $this->display, $this->display->args, $this->display->context, $pane); $content = $cache->content; } } // Pass long the css_id that is usually available. if (!empty($pane->css['css_id'])) { $content->css_id = check_plain($pane->css['css_id']); } // Pass long the css_class that is usually available. if (!empty($pane->css['css_class'])) { $content->css_class = check_plain($pane->css['css_class']); } return $content; }
/** * Render the interior contents of a single pane. * * This method retrieves pane content and produces a ready-to-render content * object. It also manages pane-specific caching. * * @param stdClass $pane * A Panels pane object, as loaded from the database. * @return stdClass $content * A renderable object, containing a subject, content, etc. Based on the * renderable objects used by the block system. */ function render_pane_content(&$pane) { ctools_include('context'); // TODO finally safe to remove this check? if (!is_array($this->display->context)) { watchdog('panels', 'renderer::render_pane_content() hit with a non-array for the context', $this->display, WATCHDOG_DEBUG); $this->display->context = array(); } $caching = !empty($pane->cache['method']) && empty($this->display->skip_cache); if ($caching && ($cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context, $pane))) { $content = $cache->content; } else { if ($caching) { // This is created before rendering so that calls to drupal_add_js // and drupal_add_css will be captured. $cache = new panels_cache_object(); } $content = ctools_content_render($pane->type, $pane->subtype, $pane->configuration, array(), $this->display->args, $this->display->context); foreach (module_implements('panels_pane_content_alter') as $module) { $function = $module . '_panels_pane_content_alter'; $function($content, $pane, $this->display->args, $this->display->context, $this, $this->display); } if ($caching && isset($cache)) { $cache->set_content($content); panels_set_cached_content($cache, $this->display, $this->display->args, $this->display->context, $pane); $content = $cache->content; } } // If there's content, check if we've css configuration to add. if (!empty($content)) { // Pass long the css_id that is usually available. if (!empty($pane->css['css_id'])) { $id = ctools_context_keyword_substitute($pane->css['css_id'], array(), $this->display->context); $content->css_id = drupal_html_id($id); } // Pass long the css_class that is usually available. if (!empty($pane->css['css_class'])) { $class = ctools_context_keyword_substitute($pane->css['css_class'], array(), $this->display->context, array('css safe' => TRUE)); $content->css_class = check_plain(drupal_strtolower($class)); } } return $content; }
/** * Render the contents of a single pane. * * This method retrieves pane content and produces a ready-to-render content * object. It also manages pane-specific caching. * * @param stdClass $pane * A Panels pane object, as loaded from the database. */ function render_pane(&$pane) { ctools_include('context'); if (!is_array($this->display->context)) { $this->display->context = array(); } $content = FALSE; $caching = !empty($pane->cache['method']) && empty($this->display->skip_cache); if ($caching && ($cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context, $pane))) { $content = $cache->content; } else { $content = ctools_content_render($pane->type, $pane->subtype, $pane->configuration, array(), $this->display->args, $this->display->context); foreach (module_implements('panels_pane_content_alter') as $module) { $function = $module . '_panels_pane_content_alter'; $function($content, $pane, $this->display->args, $this->display->context); } if ($caching) { $cache = new panels_cache_object(); $cache->set_content($content); panels_set_cached_content($cache, $this->display, $this->display->args, $this->display->context, $pane); $content = $cache->content; } } // Pass long the css_id that is usually available. if (!empty($pane->css['css_id'])) { $content->css_id = $pane->css['css_id']; } // Pass long the css_class that is usually available. if (!empty($pane->css['css_class'])) { $content->css_class = $pane->css['css_class']; } return $content; }
?> <!-- <div class="date-text"> <?php //print render($node_author->name); ?> </div> --> </div> <h1 class="h1 secondary"><?php print $title; ?> </h1> <div class="body blog-content"> <?php print render($content['body']); ?> </div> <?php $block = module_invoke('sharethis', 'block_view', 'sharethis_block'); //dpm($block); print render($block['content']); ?> <img class="divider-line" src="/files/images/blogdivider.svg"> </div> </div> <?php $latest_blog = ctools_content_render('latest-blog', 'latest-blog', NULL, NULL, NULL, NULL); // dpm($latest_blog); print $latest_blog->content; ?>