3

I would like the template for editing articles to be different from the template for viewing articles. How can this be done?

  • 1
    I don't think that's possible. Even most advanced extension RegularLabs Advanced Template Manager, which can assign templates to everything under the Sun, cannot assign templates to an action (view or edit). – Mikan Nov 22 '16 at 11:54
7

It's actually possible by overriding it via 3rd party plugin. You can create a simple system plugin calling setTemplate() method when the onAfterRoute event occurs :

public function onAfterRoute() {
    $app      = JFactory::getApplication();
    $view     = $app->input->get('view');
    if ($view == 'form'){
        $app->setTemplate('template_name', null);
    }
}

I have created a simple plugin for this purpose. You can download it from the JSE Github.

Update : I have submitted the extension to JED and it's now listed here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.