b13/container

Display Current Container Label in Page Module

linawolf opened this issue · 1 comments

When you have several similar containers with the same column names they can only be differentiated by Icon by the editors. Is it possible to display the current containers label similar to how it was done in Gridelments?

Container:

image

Gridelements:

image

Hi @linawolf just use your own Backend-Container-Grid for rendering. This can be set during container Registration by calling setGridTemplate(EXT:<my-site-package>/Resources/Private/BackendPreview/ContainerGrid.html) (s. https://github.com/b13/container#methods-of-the-containerconfiguration-object, https://github.com/b13/container/blob/master/Resources/Private/Templates/Grid.html)
containerRecord is assign to template, so you can use containerRecord.CType

<f:if condition="{containerGrid}">
    <h4>{containerRecord.CType}</h4>
    <f:render partial="PageLayout/Grid" arguments="{grid: containerGrid, hideRestrictedColumns: hideRestrictedColumns, newContentTitle: newContentTitle, newContentTitleShort: newContentTitleShort, allowEditContent: allowEditContent}" />
</f:if>

or translate it with corrospending label of CType