Retrieve AttributeType header/footer items

Permalink
Hey all. I'm trying to grab all of the assets for an AttributeType(View) object, so that I can output them along with a block/helper that I'm building. I'm having a bear of a time trying to track down how the default Attribute view loads those assets. I'm using a custom AttributeType that I created that has form.js/form.css along with the form.php file, and it works fine in the standard "Page Properties" dialog.

Here's what I tried.. but coming up empty.
Loader::model('attribute/categories/collection');
$ao = CollectionAttributeKey::getByHandle($handle);
if (is_object($ao)) {
   $avo = Page::getCurrentPage()->getAttributeValueObject($ao);
   $at = $ao->getAttributeType();
   $atv = new AttributeTypeView($at, $ao, $avo);
   var_dump($atv->getHeaderItems());
   var_dump($atv->outputFooterItems());
}


If I var_dump($atv), I get the correct AttributeTypeView object, but I'm at a loss for where to turn on this one.

aghouseh
 
aghouseh replied on at Permalink Reply
aghouseh
Ahh, scratch that.. In the AttributeTypeView the render() method does a very simple call to get those items that I overlooked.

$js = $this->attributeType->getAttributeTypeFileURL($view . '.js');
         $css = $this->attributeType->getAttributeTypeFileURL($view . '.css');


Thanks anyway folks! :) Hope someone can save headache with this.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.