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.
Hi,
How can I specify the fields that are displayed in my bundle overview screen ? having only numbers being displayed is not very helpful for the users managing the content in the bundles.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
eck_problem.png | 15.76 KB | drupalpal |
Comments
Comment #1
pascalduez CreditAttribution: pascalduez commentedHi,
you might want to look at
hook_entity_label()
, so you can display some fields or properties from your custom entities, for instance if you added a title field to this entity bundle...Comment #2
Toxid CreditAttribution: Toxid commentedI also wonder if there's some way to do this. I would like to sort on a custom property column that I've added. Also I would like other titles on the overview page than on the entity view page. So hook_entity_label won't work for me since it affect both. Is it possible to override or do a hook_alter the eck__entity__overview function?
Comment #3
fmizzell CreditAttribution: fmizzell commentedSorry it has taken me so long to respond. In alpha-3, everything is managed through a function called entity_table, or entities_table (something like that). Anyways, in this function there are two hooks, one to modify table rows, and one to modify the header of the table.. the entity gets passed to the hook implementors so you can get any data you want from the entity and display it. I have been hesitant to post this because the more I think about this problem the more I think that ECK should be using Views module to generate the entity overview (list) page. This would give us way more flexibility in terms of customization from the UI, and we could do more advanced things like sorting and filtering on our administration tables. What do you think about the views solution?
Comment #4
ydnar79 CreditAttribution: ydnar79 commentedJust read over the issue and I personally feel that the views approach would be the best overall. It would allow for easy modification to the UI as well as reduce the amount of work required to improve/update/add new features to the module. (Since much of the UI would be taken care of elsewhere.)
Just my 2 cents....
Comment #5
fmizzell CreditAttribution: fmizzell commentedECK also comes with a title behavior that can be attached to any property. The behavior causes for the property to become a label, and it will be display on the entity table.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedI stumbled about this topic during my research for the same problem. I agree views is the best solution, but until now I would like to know which hooks do you mean? I looked in the function entity_table($entities, $select = FALSE) but which hooks do you mean for extending the header and rows? Can you give me a hint?