I am using Features module and Strongarm to add variable to my feature.
The value of this variable is id of menu item.
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'taxonomy_menu_vocab_parent_blog_category';
$strongarm->value = '396';
$export['taxonomy_menu_vocab_parent_category'] = $strongarm;
The problem is that on other site, where i enable my feature - that menu item has other id (not 396) - that is why this variable points to wrong menu item.
How i can solve this?
Can i transparently change this numeric id to something more site-independent (for example menu name plus menu item path, so instead 396 i will got "main-menu:blog") while variable is exported and imported?
Maybe i can write some preprocess function for this custom variable?
Comments
Comment #1
hefox commentedhook_strongarm_alter; either override it there via looking up mlid or just define the variable there. Or have a seperate module with hook_strongarm in it defining the variable dynamically. (You don't actually have to use strongarm without features. It works fine by itself, thus the lack of dependency on features. )
Comment #2
DrupalDriven commentedhook_strogarm_alter seems not to work properly
i have tried
But in downloaded feature file i still have old value of 'taxonomy_menu_vocab_parent_blog_category'.
I use the latest version of features and strongarm modules
What i am doing wrong?
Comment #4
skwashd commentedI think #2076543: Provide hooks for altering values on import and export will be a better way of solving your problem. You can even include the hook_strongarm_export_value_alter() and hook_strongarm_import_value_alter() in the .module file of your feature.