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?
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?
Did you ever work this out? I would like to do something similar with a File sets attribute
Also see this for more details:
http://www.concrete5.org/community/forums/customizing_c5/how-to-wan...
http://www.concrete5.org/community/forums/customizing_c5/how-to-wan...
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.
$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
$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