Global Sidebar

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:
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.
 
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.
You really need a screenshot?:D

sidebar1.webp


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


I hoped that i could do it via event listeners, instead of changing the original xenforo templates
 
Last edited:
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?
 
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?
No, i don't have to use it, but xenforo is using it

responsemessage.webp

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.
 
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.
 
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.
 
Back
Top Bottom