2

I've been going through the Craft EntryCount plugin on Mijingo and I've hit a bit of a problem, the way the tutorial shows how to modify the entries table to include the pageviews count doesn't seem to work, I've got the below code in my main plugin file. Does anyone know what the problem is?

public function modifyEntryTableAttributes(&$attributes, $source) 
{
    if($this->getSettings()->showCountOnEntryIndex)
    {
        $attributes['count'] = 'Count';
    }
}

public function getEntryTableAttributeHtml(EntryModel $entry, $attribute) 
{
    if($this->getSettings()->showCountOnEntryIndex AND $attribute == 'count')
    {
        return craft()->entryCount->getCount($entry->id)->count;
    }

}

Your Answer

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

Browse other questions tagged or ask your own question.