I have some menus that are managed in the standard Menus module (Drupal 6, BTW). I want to add a checkbox when I'm editing a menu item to control the display of a "New" banner via CSS (by adding a class for items that have the checkbox turned on).
I can get my checkbox into the form like so:
function mymodule_form_menu_edit_item_alter(&$form, &$form_state) {
$form['menu']['newbanner'] = array(
'#title' => 'New banner',
'#type' => 'checkboxes',
'#description' => "Add a 'New' banner to this item?",
'#options' => array( 'new_banner' => t("This item is new") )
);
}
But I'm not quite sure how to actually save and use the state of my checkbox. I'm guessing I want to start by creating a mymodule_form_menu_edit_item_submit()
function? But how do I get my info in/out of the database and use it to add a class to the generated menu on the front-end?
variable
table to store my checkbox state, or is that bad form?