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 Answer
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.
-
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. 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. 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
-