How can i use page_types with its own php file in packages?
Permalink
I need a package that adds a single_page with its own page_type. Unfortunately, the single_page uses the standard-view of the theme and not the page_type.
These are my folder
This here is my code in the controller
Does anyone know what I mean and can help me?
These are my folder
packages rss page_types rss.php single_pages rss.php
This here is my code in the controller
public function install() { Loader::model('collection_types'); Loader::model('collection_attributes'); Loader::model('attribute/categories/collection'); $pkg = parent::install(); SinglePage::add('/rss/', $pkg); $current = PageTheme::getSiteTheme(); $theme = CollectionType::getByHandle($current->getThemeHandle()); if(!$theme || !intval($theme->getCollectionTypeID())){ $theme = CollectionType::add(array('ctHandle'=>'rss','ctName'=>t('RSS Vorlage')),$pkg); } }
Does anyone know what I mean and can help me?
Thank you, you understood me correctly.
Is there any chance to assign a different template for a single page?
...and that out of a package?
Is there any chance to assign a different template for a single page?
...and that out of a package?
You can manually call the render method or add a check in view.php and include something different.
These things are a bit ugly though.. I don't think there's a nicer way!
These things are a bit ugly though.. I don't think there's a nicer way!
Ok, thanks Remo...i have it.
I put a blank theme in the package and change the render methode like that:
I put a blank theme in the package and change the render methode like that:
public function view() { $v = View::getInstance(); $theme = PageTheme::getByHandle('rss'); $v->setTheme($theme); $this->render("rss"); }
Sorry for that, but my final answer is not working.
How can I call the Render method with a new theme?
How can I call the Render method with a new theme?
There's a variable $innerContent in view.php which gets filled with the content of your single page.