From b8403dcfdbcb38df4e550dbc6bbc1a0145605380 Mon Sep 17 00:00:00 2001 From: Hans Kuijpers Date: Sat, 31 Jan 2015 00:16:45 +0100 Subject: [PATCH] step 17 - conditional load page layout --- helper.php | 11 +++++++- index.php | 49 ++++++++++++++++++++++++++---------- pagelayout/1column.php | 8 ++++++ pagelayout/2column-left.php | 17 +++++++++++++ pagelayout/2column-right.php | 17 +++++++++++++ pagelayout/3column.php | 20 +++++++++++++++ pagelayout/homepage.php | 8 ++++++ 7 files changed, 116 insertions(+), 14 deletions(-) create mode 100644 pagelayout/1column.php create mode 100644 pagelayout/2column-left.php create mode 100644 pagelayout/2column-right.php create mode 100644 pagelayout/3column.php create mode 100644 pagelayout/homepage.php diff --git a/helper.php b/helper.php index 37a422b..21a8058 100644 --- a/helper.php +++ b/helper.php @@ -55,7 +55,6 @@ // Check upon the current page layout $pagelayout = $this->params->get('pagelayout', '1column'); - // Determine whether to show sidebar-A (@todo: Jisse, clean up this mess) $SidebarA = false; $SidebarB = false; @@ -89,3 +88,13 @@ { $pagelayout = '3column'; } + + if($helper->isHome()) + { + $pagelayout = 'homepage'; + } + + + + + diff --git a/index.php b/index.php index 5e5706f..e965e5a 100644 --- a/index.php +++ b/index.php @@ -15,19 +15,42 @@
-
-
-
- getMessageQueue())):?> - - - -
-
- -
-
-
+ countModules('content-top')): ?> + + + + template.'/pagelayout/homepage.php'; + break; + + case '1column': + include_once JPATH_THEMES.'/'.$this->template.'/pagelayout/1column.php'; + break; + + case '2column-left': + include_once JPATH_THEMES.'/'.$this->template.'/pagelayout/2column-left.php'; + break; + + case '2column-right': + include_once JPATH_THEMES.'/'.$this->template.'/pagelayout/2column-right.php'; + break; + + case '3column': + include_once JPATH_THEMES.'/'.$this->template.'/pagelayout/3column.php'; + break; + + default: + include_once JPATH_THEMES.'/'.$this->template.'/pagelayout/1column.php'; + } + ?> + countModules('content-bottom')): ?> + +