No attribute types in drop down box
Permalink
Hi,
I am creating a custom package and have managed to use the attribute model pretty well however where I would normally see a list of attribute types (select, text, date etc) in the drop down to "Add Attribute" I am seeing nothing.
I have this in my model:
And this in my controller:
And this in the view:
Am I missing something somewhere? Do I have to specify somewhere what type are allowed? I want them all really.
Thanks in advance!
I am creating a custom package and have managed to use the attribute model pretty well however where I would normally see a list of attribute types (select, text, date etc) in the drop down to "Add Attribute" I am seeing nothing.
I have this in my model:
And this in my controller:
public function __construct() { parent::__construct(); $otypes = AttributeType::getList('frankjobs'); $types = array(); foreach($otypes as $at) { $types[$at->getAttributeTypeID()] = $at->getAttributeTypeName(); } $this->set('types', $types); }
And this in the view:
<?php echo $form->select('atID', $types)?>
Am I missing something somewhere? Do I have to specify somewhere what type are allowed? I want them all really.
Thanks in advance!
Fixed it with this in my install method:
// install Attribute Category $allowSets = false; $akc = AttributeKeyCategory::add('frankjobs', $allowSets, $pkg); //associate default Attribute Types to be used with this new attribute category for($i=1; $i<9; $i++) { $akc->associateAttributeKeyType(AttributeType::getByID($i)); }
Has anybody else experienced this?