public static function render_page() { $page_template = papi_get_page_type_template(); if ($page_template) { $page_template = rtrim($page_template, '.php'); bladerunner($page_template); } else { bladerunner('views.pages.index'); } }
static function render_modules($property_slug) { $relations = papi_get_field($property_slug); if ($relations) { foreach ($relations as $key => $relation) { $blade_template = rtrim(papi_get_page_type_template($relation->ID), '.php'); $view = view($blade_template, ['module' => papi_get_page($relation->ID)]); $pathToCompiled = $view->path; include $pathToCompiled; } } }
/** * Include template files from Papis custom page template meta field. * * @param string $original_template * * @return string */ function papi_template_include($original_template) { global $post; // Check so we only change template on single and page posts. if (!is_single() && !is_page()) { return $original_template; } // Only load a template if it exists. if ($page_template = papi_get_page_type_template($post->ID)) { if ($template = locate_template($page_template)) { return apply_filters('papi/template_include', $template); } } return $original_template; }
/** * Include template files from Papis custom page template meta field. * * @param string $original_template * * @return string */ function papi_template_include($original_template) { global $post; // Check so we only change template on single and page posts. if (!is_single() && !is_page()) { return $original_template; } if ($page_template = papi_get_page_type_template($post->ID)) { return locate_template($page_template); } return $original_template; }
if ($frontpage_id = get_option('page_on_front')) { if ($frontpage_modules = papi_get_field($frontpage_id, 'sidebar')) { $sidebar_modules = $frontpage_modules; } } } ?> @if(sizeof($sidebar_modules)) @foreach($sidebar_modules as $module) @if(Groups_Post_Access::user_can_read_post($module->ID)) <?php if (papi_get_field($module->ID, 'anonymous_only') && is_user_logged_in()) { continue; } ?> <div class="row"> <?php $post = get_post($module->ID); setup_postdata($GLOBALS['post'] =& $post); bladerunner(rtrim(papi_get_page_type_template($module->ID), '.php')); ?> <p> </p> </div> @endif @endforeach <?php wp_reset_postdata(); ?> @endif
<?php $template = papi_get_page_type_template(get_the_ID()); $template = str_replace('/', '.', $template); $template = str_replace('.php', '', $template); switch ($template) { case 'views.pages.standard': bladerunner('views.pages.standard'); break; default: bladerunner('views.pages.page'); break; }