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
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?

Asseco
 
Remo replied on at Permalink Best Answer Reply
Remo
I'm not sure if I understand your problem correctly but a single page doesn't have a page type. A single pages always uses view.php of your theme.

There's a variable $innerContent in view.php which gets filled with the content of your single page.
Asseco replied on at Permalink Reply
Asseco
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?
Remo replied on at Permalink Reply
Remo
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!
Asseco replied on at Permalink Reply
Asseco
Ok, thanks Remo...i have it.

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");
}
Asseco replied on at Permalink Reply
Asseco
Sorry for that, but my final answer is not working.
How can I call the Render method with a new theme?