Adding SELECT attribute options for a page
PermalinkCollectionAttributeKey::add('tab_attr', t('Tab Attribute'), false, null, 'SELECT');
Now I want to add the values (options) per page level
$ak=CollectionAttributeKey::getByHandle('tab_attr'); SelectAttributeTypeOption::add( $ak, 'Tab1', 0, 0);
The above code will add the options globally, but I want it in page level.
I'm trying the following code, but it is not working
$curPage = Page::getCurrentPage(); $curPage->setAttribute($ak, 'Tab1');
How to add the SELECT attribute for a page, so that I can get the following values
$options = $curPage->getCollectionAttributeValue('tab_attr');
Thanks in advance for your help,
Bala

If I follow the steps manually, as mentioned in the below page, I'm able to get different options for the same attribute
http://www.concrete5.org/documentation/how-tos/developers/creating-...
I'm just wondering, how to do this through scripting
Thanks,
Bala
// This is jquery-ish pseudo-code to outline the solution switch (page_path) case 'a/page/path' $(the_attribute_select options).each(function(){ if (this_option_value is_not_wanted){ $(this_option).remove() } }); // etc....
This would obviously require some development work and would need to be loaded and execute when the attribute value was edited.
$opt = SelectAttributeTypeOption::add($ak, 'Tab1', 0, 0); $curPage->setAttribute($ak, $opt);
and getting the values properly by using $curPage->getCollectionAttributeValue('tab_attr');
Thanks,
Bala
As Jordan said, I think its better to have separate attributes per page.
Can anybody please tell me how multiselect works for a page
Thanks,
Bala
Basically I'm creating a TAB component based on this SELECT attr.