1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom XenForo ViewPublic - Account

Discussion in 'XenForo Development Discussions' started by Adam K M, Jul 25, 2014.

  1. Adam K M

    Adam K M Active Member

    Hello,

    I'm currently working on developing a custom page that can be found in the 'settings'/'personal details' area. I've figured out just about everything that I need to do, however, I am unfamiliar with the "Xenforo_ViewPublic_Account" php files, and how to make one of them render out my own template instead.

    From looking at the PersonalDetails.php in the XenForo/ViewPublic/Account folder, maybe this is code that can be adapted to run my own custom template, account_templateName.
    PHP:
    <?php

    class XenForo_ViewPublic_Account_PersonalDetails extends XenForo_ViewPublic_Base
    {
        public function 
    renderHtml()
        {
            
    $this->_params['aboutEditor'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate(
                
    $this'about'XenForo_Visitor::getInstance()->get('about')
            );
        }
    }
    Can someone please help me with this? Any pointers would be greatly appreciated.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Can you explain exactly what you're trying to do?

    Basically this line added to that file will use a different template instead of account_personal_details:

    PHP:
    $this->_templateName 'test';
     
    Adam K M likes this.
  3. Adam K M

    Adam K M Active Member

    I am trying to add my own page to the "Your Account" area of the forums. I've added the menu item, I just need it to work.
    progress.PNG
    You can see at the bottom of this thumbnail "Guild Area" is the page I'm trying to create.
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    You want to add a new action to the Account controller. You don't need a view.
     
  5. Adam K M

    Adam K M Active Member

    So in the account controller, which I'm looking at, I can just
    use that as a response in my action? Sweet! Thanks a lot!
     
  6. Chris D

    Chris D XenForo Developer Staff Member

Share This Page