View more context

 

Hels

Is it possible to use logic in a page controller to choose between 2 different Layout templates? something like if $currentMember is in group A then use layout template A else use layout template B

Hels

tfft!! probably the first time I got a correct approach on the first try!!! 😉

dorsetdigital

You could use renderWith() to specify the template which is used to render the page.

or

You could probably have a separate function for the different pages, and use the template magic to render the right template automagically

dorsetdigital
  1. public function index() {
  2. if (...) {
  3. return $this->renderWith('template1');
  4. }
  5. else {
  6. return $this->renderWith('template2');
  7. }
  8. }