Is it possible to define a new view type for tables?
Do you mean like a new set of columns?
Nope i mean view type. At the bottom of a table in page edit mode there is an option to show the table as standard list or photo. I wonder if i can define a new view type? I specifically am thinking about a more compact table that would fit in more nicely in a column next to a field editor. If i implement this with a template i loose the ability to use row actions and global actions.
Hi William, Technically yes there is a way to implement custom Views for a Table, but we are not encouraging this as of yet and have not documented how to do it. As far as your use case for “a more compact table” that would fit in more nicely in a column, but still has Row Actions and Global Actions — a custom view would not offer you the ability to retain Row Actions, as these are handled by the default “List” view, so you’d have to recreate the logic that processes these Row Actions. While I personally would love to write up a tutorial on how to make custom views, I don’t think this is really the right approach to your use case. What about the standard Table view is particularly problematic? Is it that the Column header cells are too wide, or that the table cells themselves are too wide? If so, you could probably adjust the CSS of the table body / header cells to make them “more compact”. We’ve put “small tables” into columns alongside field editors before, using the standard table renderer, and they usually fit pretty well.