Override components/com_users/models/forms/login.xml - Joomla 2.5?

后端 未结 3 691
暗喜
暗喜 2020-12-21 11:09

I\'ve been trying to override the file login.xml but no matter what I try, the edited version in my template folder doesn\'t show up. How can I override this fi

3条回答
  •  一个人的身影
    2020-12-21 12:02

    The answer posted in the forum that @Shaz definitely works, but for Joomla 3.X you have to tweak a little, so it would be

    First of all you copy

    /components/com_users/models/forms/login.xml
    

    To

    /templates/YOUR_TEMPLATE/html/com_users/login/forms/login.xml
    

    And place this piece of code right at the top

    if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
    
    $this->form->reset( true ); // to reset the form xml loaded by the view
    $this->form->loadFile( dirname(__FILE__) . DS . "forms" . DS . "login.xml"); // to load in our own version of login.xml
    

    This did the tick for me a kudos for the user @dylanjh that posted the original answer on the Joomla forum

提交回复
热议问题