Forum

Thread tagged as: Question, Problem, Error

Perch Template Categories Tag - Order being ignored

Hi,

I am using the following notation in a Perch template file:

<perch:categories id="accreditations" label="Accreditations" set="accreditations">
    <perch:category required="true" id="catTitle" type="text" label="Accreditation Title" />
</perch:categories>

This successfully allows the users to select as many of the accreditations in the set as they like - but the order is ignored.

Not matter the saved order, Perch forces the list to be saved alphabetically. Our client want's the ability to set which comes first, and they are positioned in order of importance.

Is there a parameter to tell Perch to respect the order? Or is this a bug?

Thanks

Matthew Lymer

Matthew Lymer 1 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version of Perch are you using? Can you post your diagnostics report?

Hi Drew,

No worries - your question has resolved my issue. I am on Perch 3.0.11 and can see this bug has been fixed in Perch 3.0.12.

Thanks!

Hi Drew,

Sorry to say I'm back - Perch 3.0.12 and categories are still not obeying order. Does it require any specific configuration? Or do I need to republish?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Where is the order not being obeyed?

Hi Drew,

In a perch template (when editing a region), I have a perch categories block (<perch:categories>...) - this functions correctly, but no matter which order I set the categories, they reset to be alphabetic (they are displayed in my intended order, but once I save the region, they have been saved alphabetically).

Before Save: https://drive.google.com/open?id=1NK8vKASB5BWbitHZ93CRz2mmCsn-rKV_

After Save: https://drive.google.com/open?id=1Jcf9yuvMh8PyctneWwuRGm6Nq9h8oK31

You can view these before and after shots - the order resets when saved...

Regards,

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think there's a specific order to that relationship at all. I'll check though.

But version 3.0.12's change log lists: "Fixes a bug with categories losing their ordering on edit" - isn't that my exact problem?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you using Perch or Runway?

I'm using the standard Perch version.

Drew McLellan

Drew McLellan 2638 points
Perch Support

So that fix was relating to the order of items within a category set that has been manually reordered. There's no order on the relationship between an item and its categories. The order of the categories for an item to should reflect the order of the items within their category set.