What I'm looking for is to add in a custom column that either has a checkmark or not based on if the entry's slug has a certain set of characters.


This would get a check: sluggyslug-SC_01234X

This would not: sluggyslug

I would be looking at the slug and matching via regex for the SC_XXXXX portion.

I see there is the hook defineAdditionalEntryTableAttributes and getEntryTableAttributeHtml but I get an error when I try to set them.

The code I tried in my plugin:

public function defineAdditionalEntryTableAttributes()
    return array(
        'something' => "Some Column",

public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)
    if ($attribute == 'something')
        if (preg_match("/(?:SC_\w{5})$/", $entry->slug)) {
          return '<div class="center">&#x2713;</div>';

If I try to add the column, I just get this via the getElements ajax call.

Property "Craft\EntryModel.something" is not defined.

Is there anyway to add a column like this?


The error points to a missing corresponding field with handle 'something' in the entry model.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.