Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By DrupalDope on
I have a node that displays an unlimited number of related "rendered entities" - I see they are displayed according to their NID in ascending order. How can I display them according to date created, descending order? The sorting option available within "manage fields" does not seem to affect output.
Comments
I'm sorry your post isn't
I'm sorry your post isn't completely clear to me, but to my knowledge a node does not "display an unlimited number of related entities". That would be functionality usually provided by views, and most likely added to the page as a block. So you can probably find the sorting options you want amongst your views.
Did i answer your question on the forums? I love to hear a reply wether or not it worked for you!
Jaap - Acquia certified drupal site builder
Well, the node does that
Well, the node does that through an entity reference field with a 1-n cardinality, it's even possible to add pagination.
Views would be my second choice if fixing the sort order in that field doesn't work, because views is so damn difficult because unfriendly and confusing.
An entity reference field in
An entity reference field in itself doesn't display rendered related entities either, unless some contrib module added that functionality. However, the most likely situation is still that you are looking at an existing view in a block, and that you need to change that view in order to change the sorting order.
On the subject of views: it takes some getting used to to appreciate it. There is enough documentation and tutorials out there (ask google about it). Even then, changing a sort order shouldn't be hard, even when having little experience with views.
Did i answer your question on the forums? I love to hear a reply wether or not it worked for you!
Jaap - Acquia certified drupal site builder
the output of rendered
the output of rendered entities as an unlimited items list is a native funtion of the entity reference module.
see here:
http://atendesigngroup.com/blog/getting-started-references-drupal
I checked the views, but no view is active on my site, so nothing to modify there.
ok, I found a catch 22.
ok, I found a catch 22.
I have correctly setup a view that gives me the desired results *in the view*
I have successfully used the view instead of the simple filter on the entity reference field.
and here is the catch: the sorting in the "manage fields" section only applies to the "add content" form. indeed, the reviews are sorted and filtered in every way I could want them to be, but it only applies to the "add content" form.
the entity reference field that gets published remained unimpressed.
the display is controlled by "manage display", where the entity reference field does not offer any sorting options.
.
.
.
so, now I need to figure out how to get my view displayed? is it possible to add it as a display field ?
viewreference
Try https://www.drupal.org/project/viewreference.
It is not the most elegant option and you must re-save all nodes with the correct view display selected but it will work and you can manage it like a field in the display settings.
thank you - I have solved my
thank you - I have solved my issue by using EVA fields