mmikkel / DashCols-Craft

Easily add custom fields to index tables in Craft CMS
MIT License
56 stars 4 forks source link

Add meta field from entry author #21

Closed migplay closed 9 years ago

migplay commented 9 years ago

I got a category field (country) assigned to some users. I d like to display this category info (so the entry author category) in a column in my entries listing view. But I think not possible now with DashCols no ?

mmikkel commented 9 years ago

I'm not sure I understand, could you please rephrase or be more specific?

DashCols is able to output Category fields – it will only display the name of the categories, though (as a hyperlink to that category in the CP).

migplay commented 9 years ago

I want to display the entry's author's category like here the col Région image

But Région is a Category field assigned to Users image

mmikkel commented 9 years ago

Ok – I understand now, thank you. Unfortunately, that's not currently possible and probably never will be as I think it would make the plugin's UI more complex than it needs to be. As such I'm closing this issue.

Have you tried the Zenbu plugin though? I'm not sure if it can help you out but it has a lot of features that DashCols doesn't have, so it might be worth a look.

Other than that, it'd be relatively easy to write your own plugin to hard code the entry's author's categories to the entry listing view. Something like this: https://gist.github.com/mmikkel/450306a143310d935e76

Note: The Gist is untested and might not work as-is, but the general concept should be legit. The two methods should be added to your own plugin's primary class – see the official docs for more info on creating a plugin. https://buildwithcraft.com/docs/plugins/introduction

migplay commented 9 years ago

Great thank you. Yes I did the plugin as you said with theses function. It works great. Thx for answers.

mmikkel commented 9 years ago

Happy to hear you got it sorted ;)