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

后端 未结 3 690
暗喜
暗喜 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:14

    Here's a solution:

    http://forum.joomla.org/viewtopic.php?t=583380#p2375649

    I just tested it in Joomla 2.5.3 and it works.

    Update

    here is the solution copied from above URL

    We can override output by using the normal template override feature. For me, I'm trying to override the login page. So, I'm taking a copy of /components/com_users/views/login/tmpl/default.php and putting it into /templates/beez_20/html/com_users/login.

    Now take a copy of /components/com_users/models/forms/login.xml and place in /templates/beez_20/html/com_users/login as well.

    Then edit /templates/beez_20/html/com_users/login/default.php and add at the top of the form (I added mine just after the form tag) the following lines of code:

    // to reset the form xml loaded by the view
    $this->form->reset( true );
    
    // to load in our own version of login.xml
    $this->form->loadFile( dirname(__FILE__) . DS . "login.xml");
    

    Similarly you can safely edit /templates/beez_20/html/com_users/registration/registration.xml to modify the registration form.

提交回复
热议问题