Page 1 of 1

Adding custom field in ListGrid

Posted: Tue Nov 08, 2016 3:48 am
by smabrouk
Hi all,

When i navigate to Catalog -> Categories in Admin site all Categories appears in a table with Name and Url columns all i want to do is to add the Category id in a new column.
Actually i followed this documentation and i used XML-based overrides method:

I added this to my applicationContext:

Code: Select all

<beans xmlns=""



and i added this overrides as well in applicationContext:

Code: Select all

    <mo:override id="blMetadataOverrides">
        <mo:overrideItem ceilingEntity="org.broadleafcommerce.core.catalog.domain.Category">

            <mo:field name="url">
                <mo:property name="friendlyName" value="CategoryUrl" />
                <mo:property name="prominent" value="false" />
                <mo:property name="excluded" value="true" />

            <mo:field name="id">
                <mo:property name="visibility" value="VISIBLE_ALL" />
                <mo:property name="friendlyName" value="CategoryId" />
                <mo:property name="prominent" value="true" />
                <mo:property name="excluded" value="false" />

The result is id field is not displayed as column in Category table but i was able to hide url column.

How can i do that displaying id column in Category table?


Re: Adding custom field in ListGrid

Posted: Tue Nov 08, 2016 10:21 am
by jocanas
Hi smabrouk,

The id's follow a different pattern since they are explicitly hidden. This was chosen because for the most part, the BLC specific IDs tend to be meaningless and implementors need their own product/category IDs.

Having said that, you can enable them by setting the following property in one of your properties files:

Code: Select all


Just note that this enables all IDs.