Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Implements hook_init()
- * @see http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_init/7
- */
- function testModule_init() {
- // @see http://drupal.stackexchange.com/questions/49398/how-to-change-views-field-settings-programmatically
- $view_name = 'test_content_type_views';
- $view = views_get_view($view_name, TRUE);
- $view->display['page_1']->display_options['fields']['field_test_image_1']['settings']['colorbox_node_style'] = 'large';
- views_save_view($view);
- // later, commenting out the code above, and checking the values with dsm():
- $view_name = 'test_content_type_views';
- $view = views_get_view($view_name, TRUE);
- $image_field_settings = $view->display['page_1']->display_options['fields']['field_test_image_1']['settings'];
- dsm($view, '$view in '.__FUNCTION__.'()');
- dsm($image_field_settings, '$image_field_settings in '.__FUNCTION__.'()');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement