0

I'm trying to sort the entries. Is there a way to do this without using the filters given? Can this be done manually?

1
  • Can you provide more details? It's quite unclear as to what you're asking... What do you mean "without using the filters given"? What do you mean "manually"?
    – Lindsey D
    Commented Jan 14, 2016 at 6:33

1 Answer 1

2

Are you wanting to drag entries up and down to sort them? As far as I'm aware the only way to order manually would be to use a Structure and not a Channel.

Alternatively if you just want to manually order them for use in a for loop (such as showing news items), you could add an entries field somewhere (in a global, a news page, a homepage, or somewhere else convenient). Then you can reference that list for your entries output. That would let you manually order them.

16
  • Yes, I am using a channel with multiple entries like this- {% for entry in craft.entries.section('work').limit(5) %} <a href="{{ entry.url }}"> <div class="mainImage" style="background-image:url({{ entry.mainImages.first.url }});"> {% endfor %} They are sorted by when they were created and I want to sort them by image.
    – stan60457
    Commented Jan 14, 2016 at 14:13
  • So in this instance you could add a field to the page they appear on, then call that field instead of craft.entries.section.... E.g. {% for work in entry.workList.limit(5) %} Commented Jan 14, 2016 at 14:47
  • I created a field called List for the work entries. Should I give them a number put them in order and then call them like this-{% for work in entry.workList.limit(5) %}. That doesn't seem to work.
    – stan60457
    Commented Jan 21, 2016 at 2:06
  • Stan your code looks fine. You shouldn't need to give them a number or anything, you can just drag and drop to reorder the list. Can I ask what version number of Craft you're using? Commented Jan 21, 2016 at 10:07
  • I'm using the most recent version.
    – stan60457
    Commented Jan 21, 2016 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.