Get list of custom page attribute values (select list)

Permalink
I have a custom page attribute of type select. I need to print a list of the available options on a page. My goal is not to print out the selected attribute of current page, but to print out the options available to be chosen for the attribute.

The desired data seems to be in atSelectOptions table with related akID's, but I'm not sure how to get the data...any ideas?

 
TheRealSean replied on at Permalink Reply
TheRealSean
Did you ever work this out? I would like to do something similar with a File sets attribute
beebs93 replied on at Permalink Best Answer Reply
beebs93
This should get you started:

$arrOptions = array();
$ak = CollectionAttributeKey::getByHandle('select_page_attribute_handle_here');
$akc = $ak->getController();
$arrOptions = $akc->getOptions();
foreach($arrOptions as $objOption){   
   echo $objOption->value . '<br />';
}
jordanlev replied on at Permalink Reply
jordanlev
Ale replied on at Permalink Reply
Thanks beebs93. This was an older thread and if I recall correctly I got around the problem somehow, but your solution looks much more convenient.
tudorsv replied on at Permalink Reply
$at_cat = AttributeKeyCategory::getByHandle('collection');
$at_key = $at_cat->getAttributeKeyByHandle('your_at_key_handle');
$at_key_id = $at_key->getAttributeKeyID();

$at_key->render('form');
$at_key->outputSearchHTML(); //similar to render