diff --git a/src/Framework/KalathemeBootstrap.php b/src/Framework/KalathemeBootstrap.php
index 9887e68..c6c6a59 100644
--- a/src/Framework/KalathemeBootstrap.php
+++ b/src/Framework/KalathemeBootstrap.php
@@ -21,11 +21,6 @@ class KalathemeBootstrap extends KalathemeBase implements KalathemePagePreproces
*/
public function preprocessHtml(array &$variables) {}
- /**
- * {@inheritdoc}
- */
- public function preprocessPage(array &$variables) {}
-
/**
* {@inheritdoc}
*/
diff --git a/src/Theme/KalathemeBase.php b/src/Theme/KalathemeBase.php
index 5437af0..652c388 100644
--- a/src/Theme/KalathemeBase.php
+++ b/src/Theme/KalathemeBase.php
@@ -7,6 +7,7 @@
namespace Drupal\kalatheme\Theme;
+use Drupal\block\Entity\Block;
/**
* Defines base class to be used with all Framework Classes.
@@ -100,6 +101,36 @@ public function libraryBuild() {
return $libraries;
}
+ /**
+ * Return altered variables for the page template.
+ *
+ * @return array
+ * An associative array of the same format as returned by
+ * template_preprocess_page().
+ *
+ * @see template_preprocess_page
+ */
+ public function preprocessPage(array &$variables) {
+ // Get active theme
+ $theme = \Drupal::theme()->getActiveTheme()->getName();
+
+ // Load all the blocks to parse through.
+ $blocks = Block::loadMultiple();
+ // We are adding all the blocks so we can.
+ // achieve for the One content region setup.
+ foreach ($blocks as $key => $block) {
+ $check = strstr($key, '_', TRUE);
+ // Check is the block name matches the theme.
+ if ($check == $theme) {
+ $name = ltrim(strstr($key, '_'), '_');
+ // Load the block as a var to use in the page.html.twig.
+ $variables[$name] = \Drupal::entityManager()
+ ->getViewBuilder('block')
+ ->view($block);
+ }
+ }
+ }
+
/**
* Return altered attachments to a page before it is rendered.
*
diff --git a/src/Theme/Preprocess/KalathemePagePreprocessInterface.php b/src/Theme/Preprocess/KalathemePagePreprocessInterface.php
index 5d7e97c..e6f4159 100644
--- a/src/Theme/Preprocess/KalathemePagePreprocessInterface.php
+++ b/src/Theme/Preprocess/KalathemePagePreprocessInterface.php
@@ -27,15 +27,4 @@ interface KalathemePagePreprocessInterface {
* @see template_preprocess_html
*/
public function preprocessHtml(array &$variables);
-
- /**
- * Return altered variables for the page template.
- *
- * @return array
- * An associative array of the same format as returned by
- * template_preprocess_page().
- *
- * @see template_preprocess_page
- */
- public function preprocessPage(array &$variables);
}
diff --git a/templates/system/page.html.twig b/templates/system/page.html.twig
new file mode 100644
index 0000000..e9ac1c7
--- /dev/null
+++ b/templates/system/page.html.twig
@@ -0,0 +1,88 @@
+{#
+/**
+ * @file
+ * Theme override to display a single page.
+ *
+ * The doctype, html, head and body tags are not in this template. Instead they
+ * can be found in the html.html.twig template in this directory.
+ *
+ * Available variables:
+ *
+ * General utility variables:
+ * - base_path: The base URL path of the Drupal installation. Will usually be
+ * "/" unless you have installed Drupal in a sub-directory.
+ * - is_front: A flag indicating if the current page is the front page.
+ * - logged_in: A flag indicating if the user is registered and signed in.
+ * - is_admin: A flag indicating if the user has permission to access
+ * administration pages.
+ *
+ * Site identity:
+ * - front_page: The URL of the front page. Use this instead of base_path when
+ * linking to the front page. This includes the language domain or prefix.
+ *
+ * Page content (in order of occurrence in the default page.html.twig):
+ * - messages: Status and error messages. Should be displayed prominently.
+ * - node: Fully loaded node, if there is an automatically-loaded node
+ * associated with the page and the node ID is the second argument in the
+ * page's path (e.g. node/12345 and node/12345/revisions, but not
+ * comment/reply/12345).
+ *
+ * Regions:
+ * - page.content: The main content of the current page.
+ *
+ * @see template_preprocess_page()
+ * @see html.html.twig
+ */
+#}
+
+{%
+ set navbar_classes = [
+ 'navbar',
+ theme.settings.navbar_inverse ? 'navbar-inverse' : 'navbar-default',
+ theme.settings.navbar_position ? 'navbar-' ~ theme.settings.navbar_position|clean_class : '',
+ ]
+%}
+
+