I have a client that is requesting the Rollback function on a content page start with most recent to least recent. Is there an easy way to do this? I couldn't find anything immediately so did some poking around and found a rollback.aspx that uses a rollback.aspx.cs. The code-behind has been compiled however so we can't edit it. Any suggestions? Thanks in advance!
Hi. The drop down list with all versions is filled from the array that's returned by the Document.GetVersions() method. And this method returns those with the predefined order - from the oldest to the newest ones. So, I think it's not possible to alter this behaviour without modifications to the core. However, I suppose that you could do it at least without rebuilding the whole umbraco - you can place a small piece of javascript code to the /umbraco/dialogs/rollBack.aspx file that will revert the order of the items in the dropdown list on the client as this page is loaded.
Change sort order in Rollback function
Hello everyone
I have a client that is requesting the Rollback function on a content page start with most recent to least recent. Is there an easy way to do this? I couldn't find anything immediately so did some poking around and found a rollback.aspx that uses a rollback.aspx.cs. The code-behind has been compiled however so we can't edit it. Any suggestions? Thanks in advance!
Phil
Hi. The drop down list with all versions is filled from the array that's returned by the Document.GetVersions() method. And this method returns those with the predefined order - from the oldest to the newest ones. So, I think it's not possible to alter this behaviour without modifications to the core. However, I suppose that you could do it at least without rebuilding the whole umbraco - you can place a small piece of javascript code to the /umbraco/dialogs/rollBack.aspx file that will revert the order of the items in the dropdown list on the client as this page is loaded.
Below is the sample of possible code:
<script type="text/javascript"> //<![CDATA[ $(function() { var opt0 = $('#<%= allVersions.ClientID %> option').first(); opt0.siblings() .remove() .each(function() { $(this).insertAfter(opt0); }); }); //]]> </script>That's awesome -- works like a champ! Thank you very much Rodion!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.