Announcement

Collapse
No announcement yet.

Articles Content Management not honoring display order

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Articles Content Management not honoring display order

    AdminCP > Articles > Content List

    Click image for larger version

Name:	Screen Shot 2023-09-24 at 12.55.07 PM.png
Views:	441
Size:	59.8 KB
ID:	27792

    Our The Front Page > Articles

    Click image for larger version

Name:	Screen Shot 2023-09-24 at 12.55.31 PM.png
Views:	58
Size:	305.3 KB
ID:	27793

    The ordering set in AdminCP isn't reflected in the Articles tab of The Front Page. Why?
    The Linux Community has given me much. I do what I can to return the favor!

    #2
    I checked the code in the widget_cmschanneldisplay template and the sort order is hardcoded to publishdate desc. There is a @TODO comment and code in the template that says "use this if we get the sort filter back" but the code doesn't include displayorder. Since they stopped development of vB5, sorting by displayorder will never be added. The same issue occurs on vB6 as the code in the template is the same.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    Comment


      #3
      Thank you for looking into this.
      The Linux Community has given me much. I do what I can to return the favor!

      Comment


        #4
        I found a way a solution but it requires editing the widget_cmschanneldisplay and adding the native usort() PHP function that is not allowed by vB to be used in a template. This function sorts the articles by displayorder. Upon saving the template, it will prompt that you are using what they term as "unsafe" function but you could ignore it and save the template anyway. Using usort() function in a template is safe and has no security implications. If you are okay with this, please let me know.
        Helpful? Donate. Thanks!
        Buy me a coffeePayPal QR Code
        Fast VPS Host for vBulletin:
        A2 Hosting & IONOS

        Comment


          #5
          There's actually a way to avoid using usort() directly in a template. You could move the usort() call to a custom API or controller that can be called from the template. Obviously, this will require a little bit of more code.
          Helpful? Donate. Thanks!
          Buy me a coffeePayPal QR Code
          Fast VPS Host for vBulletin:
          A2 Hosting & IONOS

          Comment


            #6
            I appreciate the offer, but this isn’t a deal breaker. Knowing why it doesn’t work is sufficient.
            The Linux Community has given me much. I do what I can to return the favor!

            Comment

            Users Viewing This Page

            Collapse

            There is 1 user viewing this forum topic.

            • Guest Guest

            Latest Posts

            Collapse

            Working...
            X
            Searching...Please wait.
            An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

            Please push the back button and reload the previous window.'
            An unexpected error was returned: 'Your submission could not be processed because the token has expired.

            Please push the back button and reload the previous window.'
            An internal error has occurred and the module cannot be displayed.
            There are no results that meet this criteria.
            Search Result for "|||"