How to install a new attribute in a 5.7 package?

Permalink 1 user found helpful
Found a couple of very basic howto's for converting a package to work in V5.7 but so far unable to find anything about how to do the below. Was going to try converting one of my popular add-ons to 5.7 this weekend... perhaps not :o/ Just need to be able to add an attribute programmatically.

$att = AttributeType::getByHandle('boolean');
$testAttribute3=CollectionAttributeKey::getByHandle('display_in_surefyre_calendar');
if( !is_object($testAttribute3) ) {
    CollectionAttributeKey::add($att, array('akHandle' => 'display_in_surefyre_calendar', 'akName' => t('Show this item in Calendar Nav'), 'akIsSearchable' => true, 'akCheckedByDefault' => true), $pkg);
}

surefyre
 
pvernaglia replied on at Permalink Reply
pvernaglia
In the namespace section of your controller add:

use \Concrete\Core\Attribute\Type as AttributeType;
use CollectionAttributeKey;


As you're figuring attribute stuff out please post!
surefyre replied on at Permalink Reply
surefyre
I'm going to give this a try today so if I have any success I'll feed back
to this thread!

G

Linked In <http://uk.linkedin.com/in/guyeastwood> - G+
<http://plusya.com/guy> - Fonovation Limited
<http://www.fonovation.com> - Surefyre
Design <http://www.surefyre.com>

On 20 September 2014 20:16, concrete5 Community <discussions@concretecms.com
> wrote:
surefyre replied on at Permalink Reply
surefyre
Yep, that worked :o)

Now to sort the changes for the new version of jQuery :o/