Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add class="page-<?_page?>" to all page templates

This should also fix $this->js() where it wasn't working before
  • Loading branch information...
commit 9d82cfcd4671d313cf4b4a60f79c83eb5bf58359 1 parent 099b036
@romaninsh romaninsh authored
Showing with 5 additions and 4 deletions.
  1. +1 −1  lib/ApiFrontend.php
  2. +3 −2 lib/Page.php
  3. +1 −1  templates/jui/page.html
View
2  lib/ApiFrontend.php
@@ -98,7 +98,7 @@ function layout_Content(){
return;
}
// i wish they implemented "finally"
- $this->page_object=$this->add($class,$this->page,'Content');
+ $this->page_object=$this->add($class,$this->page);
if(method_exists($this->page_object,'initMainPage'))$this->page_object->initMainPage();
}
}
View
5 lib/Page.php
@@ -34,16 +34,17 @@ class Page extends AbstractView {
function init(){
if($_GET['cut_page'] && !$_GET['cut_object'] && !$_GET['cut_region'])
$_GET['cut_object']=$this->short_name;
+ $this->template->trySet('_page',$this->short_name);
parent::init();
}
function defaultTemplate(){
- if($_GET['cut_page'])return array('page','Content');
+ if($_GET['cut_page'])return array('page');
$page_name='page/'.strtolower($this->short_name);
// See if we can locate the page
try{
$p=$this->api->locate('templates',$page_name.'.html');
}catch(PathFinder_Exception $e){
- return 'Content';
+ return array('page');
}
return array($page_name,'_top');
}
View
2  templates/jui/page.html
@@ -1,3 +1,3 @@
-<div id="<?$_name?>">
+<div id="<?$_name?>" class="page-<?$_page?>">
<?$Content?>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.