Last active
August 29, 2015 14:21
-
-
Save jesseschutt/adea2793456b25616f6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
public function modifyEntryTableAttributes(&$attributes, $source) | |
{ | |
if ($source == 'zcstalecontent:stale_content') | |
{ | |
unset($attributes['expiryDate']); | |
// zcContentData is my custom field. It has a Date/Time field and a text field | |
// that is grouped into it's own table. | |
// This is what appears to be the problem: | |
// zcContentData is returning an array from my custom field when I want it | |
// to return just the date, or $zcContentData['zcDate'] | |
$attributes['zcContentData'] = Craft::t('ZC Date'); | |
} | |
} | |
// ---- | |
public function getEntryTableAttributeHtml(EntryModel $entry, $attribute) | |
{ | |
if ($attribute == 'zcContentData') | |
{ | |
// This works. It returns an array from my custom field (zcContentData) | |
$fieldData = $entry->zcContentData; | |
if (!empty($fieldData)) { | |
// This works. If the entry has zcContentData then this returns | |
// the date specifically. | |
return $fieldData['zcDate']; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment