XF 2.0 Custom widget order problem

vexx

Active member
I've recently made a thread in the 2.x bug forum stating that I have a problem with a HTML widget, more specifically, it's order.

The thread can be found here: https://xenforo.com/community/threads/html-widget-doesnt-use-the-list-order-in-advanced-mode.142745/

However, I'm starting to think it's not a bug and maybe I'm missing something. Long story short, if I create a custom HTML widget, if I tick "Advanced mode", it doesn't matter what order I add to the widget, it will always appear last. If I untick Advanced mode, it works as desired.
 
I haven't looked in any great detail, but I think you're right that it's not a bug as I cannot reproduce it myself.

I just created a HTML widget, with advanced mode off, with a display order of 1, on the forum_list_sidebar position.

It appeared first.

If I enable Advanced mode, it stays where it is.

To troubleshoot further we'll likely need to know what position it was created in, roughly which other widgets and positions you are using, and display order etc. Basically as many details as possible to allow us to either spot the mistake or reproduce a bug.
 
I've attached a screenshot with the widget order. Each widget has its order number from 1 to 5, there are no identical orders. (even if I do identical orders, it behaves the same). I also tried to add the order "0" to this widget, same effect.

widgets.webp

The widget is a script, here's a snap of it.

widget_main.webp
 
embedder.parentNode.appendChild(s) is likely appending the content dynamically loaded with the JavaScript to the end of the parent container, which in this case would be the entire sidebar.

Above the first <script> tag add the following:
HTML:
<div>

And below the last </script> add the following:
HTML:
</div>

I reckon that will sort it.
 
Top Bottom