Permalink
Browse files

support consistent templatees for page

template/jui/page/path/to/page is checked before
template/jui/page/path_to_page (legacy)
  • Loading branch information...
1 parent b8d8d32 commit c0a37811d751487d586065bd1e7a24840b2fd13a @romaninsh romaninsh committed Mar 24, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/ApiFrontend.php
View
@@ -106,7 +106,15 @@ function pageNotFound($e){
throw $e;
}
protected function loadStaticPage($page){
- $this->page_object=$this->add($this->page_class,$page,'Content',array('page/'.strtolower($page)));
+ try{
+ $t='page/'.str_replace('_','/',strtolower($page));
+ $this->template->findTemplate($t);
+
+ $this->page_object=$this->add($this->page_class,$page,'Content',array($t));
+ }catch(PathFinder_Exception $e2){
+ $this->page_object=$this->add($this->page_class,$page,'Content',array('page/'.strtolower($page)));
+ }
+
return $this->page_object;
}
function execute(){

0 comments on commit c0a3781

Please sign in to comment.