Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Table Field: Asset Column Type #4285

Closed
richhayler opened this issue May 19, 2019 · 4 comments
Closed

FR: Table Field: Asset Column Type #4285

richhayler opened this issue May 19, 2019 · 4 comments

Comments

@richhayler
Copy link

richhayler commented May 19, 2019

It would be awesome if the table field supported all of the native Craft fields for column types.

The current inability to attach an image or file asset to a table row without installing a separate plugin doesn't seem right at this point in the maturity timeline of the CMS. It would be great to bring this into core.

@brandonkelly
Copy link
Member

Table field rows aren’t elements like Matrix blocks or Super Table rows; Table fields just store their values as JSON within its column in the content table. Which is not something we want to change – there is a lot of added overhead and complexity that comes with Matrix/Super Table. But it poses limitations on the sort of content they can store, and relations (like Assets) is one of the things we just can’t do, at least without forfeiting referential integrity which isn’t something we want to do.

We do plan on adding a Table UI mode to Matrix fields (sort of covered by #1052), which would solve this for you.

@richhayler
Copy link
Author

richhayler commented May 20, 2019

Thanks for the thorough explanation. Makes sense.

Just thinking off the cuff, and fearing this may be over complicating the issue - if there were some asset picker UI to easily grab an asset reference tag ID, or series of tags and drop those as plain text values in a table cell could this be an alternative option to achieve a very similar result?

A few use cases I have are providing an author input for data tables that allow them to include an image thumbnail or link to a .pdf attachment for each record.

For these case, where there could be 50-100 rows per entry, it seems overkill to use a matrix field and the table field obviously provides a lot simpler/cleaner UI for data input - i.e. tab to add a new row and keep typing.

The “table Ui” for matrix seems like a good option down the track.

@brandonkelly
Copy link
Member

Yeah something like that could be an option, but there wouldn’t be a way to eager-load the assets, so front end performance would suffer.

@richhayler
Copy link
Author

Thanks @brandonkelly. I'm sure someone requested a feature to be able to attach "widgets" to the right-hand sidebar... thinking along this line, if there were then an option to add a button/assets picker to the sidebar to bring up an asset modal to at least view or copy asset attributes as text (i.e. reference tag id) then this would give someone a way to get the data and drop it into a table. Appreciate that's a lot of "ifs" and a fair bit of clicking but at least this would provide a practical approach to achieve the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants