1 to 1 of 1
Is there a way in Akelos to have different actions (functions) within the same controller render with different page templates?
You can do this in RoR like:
render :action => "long_goal", :layout => "spectacular"
I'm trying to do the same in Akelos for only some of the actions in my "contact" controller, and it doesn't seem to work? Here's my code:
function searchform() {
$this->render(array('template' => 'searchform', 'layout' => 'contact_frontend.tpl'));
// Previous attempt, also didn't work:
// $this->render(array('layout'=>'contact_frontend.tpl'));
}
I've tried it without the ".tpl", just to see, but that didn't make any difference.
All the other actions in that controller are rendered with the default template for "contact", but when I try to do the above, the page is rendered with no layout at all (and no error eg. "layout template not found" or whatever either).
I'm wondering if this is something related to bug #184 - perhaps it's exactly this ticket, which is a feature due in Akelos 0.9?
I tried using renderWithLayout, but while that rendered the correct layout, it caused different errors due there being no content_for_layout present.
Do I have any options for a workaround at the moment? Or do I need to make all the actions in this controller use the same page layout? Or make another controller or something? (Actually, I'm going to try that now, making a "search" controller separate from my "contact" controller.)
1 to 1 of 1