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

Global Sidebar

Discussion in 'XenForo Development Discussions' started by xf_phantom, Jul 2, 2013.

  1. xf_phantom

    xf_phantom Well-Known Member

    I've created a global sidebar via event templatePostRender ( $containerData['sidebar'] = $template->create('my_global_sidebar'); )

    It's working for responseView, responseError but not if i use returnMessage for the controller return.

    How could i add it really global?
     
    Last edited: Jul 2, 2013
  2. ExpertPixels.com

    ExpertPixels.com Well-Known Member

    Can you provide a screenshot ? or shoot me your url and i can take a look for you... yes you and i both know i am one of the best coders gong around (JOKE !!!) but when it comes to designs / features / templates i am good at making that happen.
     
  3. xf_phantom

    xf_phantom Well-Known Member

    You really need a screenshot?:D

    sidebar1.png


    and now if i use $controller->responseMessage('..')
    sidebar2.png


    I hoped that i could do it via event listeners, instead of changing the original xenforo templates
     
    Last edited: Jul 3, 2013
  4. xf_phantom

    xf_phantom Well-Known Member

    nobody?:D
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    My first question is, do you absolutely have to use responseMessage if you can just use responseView and display the same message with your sidebar?
     
  6. xf_phantom

    xf_phantom Well-Known Member

    No, i don't have to use it, but xenforo is using it

    responsemessage.png

    and i hoped that there's a way to show it with responseMessage too, instead of changing the original responseMessage (which would result in some other bad side effects...)
    I want to avoid to change original xf methods as much as possible.
     
  7. Chris D

    Chris D XenForo Developer Staff Member

    It's not going to be possible. ControllerResponse_Message has no way of rendering any views.

    Your only hope is if you can somehow extend XenForo_Controller::responseMessage, overwrite it, and get it to return a XenForo_ControllerResponse_View instead.

    Doesn't seem good to me.

    I'd still argue that you still don't need to do this. It seems pretty drastic. Clearly you're going for a global sidebar but some of those response messages (I think most of them) render in overlays anyway and I don't think it would look particularly unusual to not see a sidebar on a message page.
     
  8. Matthew Hawley

    Matthew Hawley Well-Known Member

    Curious...what do you plan to do with the search sidebar? Looks interesting. :)
     
  9. xf_phantom

    xf_phantom Well-Known Member

    Provide a global seach for our database.
     
  10. xf_phantom

    xf_phantom Well-Known Member

    But it was a really stupid idea to use the xen:sidebar feature for this.

    Too much hacking around the xf code, too many workarounds (e.g. if i owerwrite it global with the event system, the sidebar in the report center doesn't work, so i need to verify that it isn't set already, and here i need to take care of the event listener execution orders and several other issues where found while the testing..

    I'll try to place it direct into the page_container template, which should fix all the issues.
     

Share This Page