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

Global Sidebar

xf_phantom

Well-known member
#1
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:

ExpertPixels.com

Well-known member
#2
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.
 

xf_phantom

Well-known member
#3
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.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:

Chris D

XenForo developer
Staff member
#5
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?
 

xf_phantom

Well-known member
#6
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.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.
 

Chris D

XenForo developer
Staff member
#7
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.
 

xf_phantom

Well-known member
#10
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.