Search

@nickdunn I can’t get it working. I think it’s not changing the entry_order value on sym_sections table.

What should I do?

@rainerborene I’ve had the order_entry field not sort when I added it to a section after that section already had records in it. I had to open each record and manually save it again to get the order entry fields to populate and then it started working.

Does this sound relevant to your situation?

Nick I’m trying to use the Order Entries field to help me get the previous entry and next entry via their order but I’m a bit stuck.

Here’s what I have:

mysql: value >= {$ds-read-recipe-by-id} - 1 AND value <= {$ds-read-recipe-by-id} + 1

I’m pretty sure MySQL is doing the math fine for the first part, but the + seems to be caught up as an union in the datasource filter, so I can ‘add 1’ to the current order.

Output of $where:

AND t40.value >= 2 - 1 AND t40.value <= 2 `

Any ideas?

I found a solution, may as well share it incase anyone wants to do something similar.

In my datasource I changed the filter to:

mysql: value BETWEEN {$ds-read-recipe-by-id} - 1 AND {$ds-read-recipe-by-id} OR value > {$ds-read-recipe-by-id}

I set the limit to 3, sort by Order ascending.

So pretty much it’s getting value - 1 to value (which will get 2 entries) and then it’s getting anything that’s higher then value. This would get a whole heap, but the limit of 3 stops it (does it actually stop it in the SQL I wonder otherwise this could get ugly with lots of entries?).

Once I’ve got the datasource working as I (sorta) want it, I then use this template to produce the correct result:

    <xsl:template match='read-recipe-pagination' mode='prev-next'>      
    <xsl:if test='entry[@id != $recipe]'>
        <ul class='prev-next pagination'>
            <xsl:for-each select='entry[@id != $recipe][order &lt; $ds-read-recipe-by-id + 2]'>
                <li>
                    <a href='{concat($root,"/recipes/read/", name/@handle, "/", @id,"/")}'>
                        <xsl:value-of select='name' />
                    </a>
                </li>
            </xsl:for-each>
        </ul>
    </xsl:if>       
</xsl:template>

The $recipe is my URL param of the recipe ID, so it prevents it from showing in the output (as it’s itself and I wanted the prev/next).

I’m still open to a solution that lets me + 1 to the order though :)

This extension appears to be busted with Symphony straight out of git. The “disable sorting by other columns” checkbox doesn’t appear.

Hi hoopy — what version of Order Entries and Symphony are you using? I’m fairly sure v1.8 (the latest on Github) is working properly.

The thing is that I don’t think I can tell. I pulled the Symphony from git at around 11/9/09 and the order_entries I tried the latest as of yesterday, and one I’d been using (pulling from previous Symphony projects) was from about 3 months ago.

This all is really vague information. The actual code I’m working with at the moment was from an ensemble export and I’m pretty sure that scrubs the .git jazz.

Take a look in the manifest/config.php for the Symphony version, and extensions/order_entries/extension.driver.php for each number.

Symphony is at 2.0.6 and order_entries is at 1.1. The really odd thing is that I’ve used this configuration on many sites without issue.

Hrm, I’d recommend backing up your database and trying to update Order Entries to 1.8. Previous versions definitely have bugs that have been squashed.

I love the order entries field, but I question two things about it that I wonder if they might make it more usable by people? The first one is that it doesn’t save on letting go, you have to go down to the bottom right and choose Apply, which is a little confusing because the drop down box says “With Selected…” which isn’t very descriptive.

Secondly, instead of having to add to the name of the section “Articles (drag to reorder)” I wonder if on the “Order field it could display the number, and then a little symbol that would show you could drag it. Kinda like this tutorial and demo.

I dunno, possible? Good idea?

it doesn’t save on letting go, you have to go down to the bottom right and choose Apply

It shouldn’t do. When you let go and drop the row an AJAX request is made which saves the new order. The field doesn’t add an option to the With Selected menu.

a little symbol that would show you could drag it

I’m not too keen on the icon — I’d like to leave it to the native Symphony UI to indicate “draggability” In fact you highlight a bug. On Blueprints > Pages where rows are orderable natively, the cursor changes to the “hand” to indicate you can drag ‘em. Order Entries doesn’t do this. But it should. I’ll put it on the to-do list!

I’m using this extension for the first time and it works a treat. Thanks again, Nick.

I’ve had one thought that might make it more useful, that is an option in the Field definition to only enable sorting if the ?filter=parent URL parameter is set. That way you can define contextual sorting more easily. I haven’t thought it all that carefully but I no problems spring to mind immediately. What do you reckon?

Sounds like a very niche feature. I think I understand what you’re after, but could you document a quick example please?

could you document a quick example please?

Sure thing. In my limited use I’ve found that I usually want to sort within the context of a linked relationship. An example of this might be a Section called Services with a child Gallery (related by Select Box Link) called Images. In that case, ordering the entries in Images in the root context isn’t all that useful, so I’d like a way to be able to only sort when the parent filter is set.

I realised I made a mistake in my post above, I’d assumed that ?filter=parent:1234 was the standard way of representing a parent relationship, which of course, is not true (I’d just happened to call all my SBL fields “parent”) so I’m not sure what the cleanest way of establishing the filtering context is.

Could add another option to the field along the lines of:

Only enable sorting when filtering the table by: {dropdown of fields}

I’m concerned it’s rather an edge case and the option might confuse newer users though.

Only enable sorting when filtering the table by: {dropdown of fields}

I think that would work quite nicely and, to my mind, wouldn’t be confusing at all for users setting up the Section. Where I see it being a little confusing is users doing the actual reordering, though I think that could be mediated somewhat by:

  • Making the draggability of the items on a page more obvious. The “(drag to reorder)” probably isn’t in your face enough IMO.
  • Removing the “Entry Order” column when dragging is disabled.

I think adding a sort context actually makes it much less confusing for users in the example I mentioned above. Otherwise they’re trying to reorder the items without context which I think is much harder.

An example of this might be a Section called Services with a child Gallery (related by Select Box Link) called Images. In that case, ordering the entries in Images in the root context isn’t all that useful, so I’d like a way to be able to only sort when the parent filter is set.

I understand this better now. The confusing thing for me is that you cannot sort the section independently of a filter. The sort column/direction is saved on a per-section basis inside Symphony, for all users.

Therefore I could add the proposed functionality but this would only go as far as disabling the drag/drop functionality in the “root”, and enabling it when filtering. In both instances, the section would still need to be sorted by the Order Entries column.

Are you saying in your example that in the “root” section view you’d want items ordered by their default (System Date order) and only ordered by the Order field when filtering? Because that ain’t possible…

Therefore I could add the proposed functionality but this would only go as far as disabling the drag/drop functionality in the “root”, and enabling it when filtering. In both instances, the section would still need to be sorted by the Order Entries column.

Ahh, I have installed your extension and was confused that I couldn’t reorder things the way I would expect it. There should be a hint somewhere that I have to click on the order field table heading first in order to enable drag and drop. :-)

I’m again having trouble with Order Entries (version 1.8) w/ Symphony 2.0.6.

When I check “Disable sorting of other columns when enabled” and press save on the section the checkbox comes back unchecked. Can’t drag and drop.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details