Commit 317e8033 authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3258410: Fix front page view

parent 7f20135a
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -46,6 +46,28 @@ function vardoc_homepage_install() {
      }
    }

    // Import Views.
    $storage_config_files = \Drupal::service('file_system')->scanDirectory($optional_install_path, '/^views.view.*\\.(yml)$/i');
    if (isset($storage_config_files) && is_array($storage_config_files)) {
      foreach ($storage_config_files as $storage_config_file) {
        $storage_config_file_content = file_get_contents(DRUPAL_ROOT . '/' . $storage_config_file->uri);
        $storage_config_file_data = (array) Yaml::parse($storage_config_file_content);
        $config_factory = \Drupal::configFactory()->getEditable($storage_config_file->name);
        $config_factory->setData($storage_config_file_data)->save(TRUE);
      }
    }

    // Import Blocks.
    $storage_config_files = \Drupal::service('file_system')->scanDirectory($optional_install_path, '/^block.block.*\\.(yml)$/i');
    if (isset($storage_config_files) && is_array($storage_config_files)) {
      foreach ($storage_config_files as $storage_config_file) {
        $storage_config_file_content = file_get_contents(DRUPAL_ROOT . '/' . $storage_config_file->uri);
        $storage_config_file_data = (array) Yaml::parse($storage_config_file_content);
        $config_factory = \Drupal::configFactory()->getEditable($storage_config_file->name);
        $config_factory->setData($storage_config_file_data)->save(TRUE);
      }
    }

    // Install any optional config the module provides.
    $storage = new FileStorage($optional_install_path, StorageInterface::DEFAULT_COLLECTION);
    $config_installer->installOptionalConfig($storage, '');
+9 −12
Original line number Diff line number Diff line
@@ -4,11 +4,14 @@ description: 'Vardoc: Knowledge Base System and Documentation Site'
core_version_requirement: ^9
version: 4.0.x-dev
base profile: varbase
project: vardoc
distribution:
  name: Vardoc
  install:
    theme: vartheme_claro
install:
  - system
  - action
  - tracker
  - aggregator
  - user
  - node
  - block
@@ -17,21 +20,15 @@ install:
  - image
  - views
  - file
  - fontawesome
  - block_class
  - tracker
  - aggregator
  - menu_block
  - block_content
  - block_class
themes:
  # Contrib themes.
  - bootstrap_barrio
  - vartheme_bs4
  - vardoc_theme
  - seven
  - claro
  - vartheme_claro

  # Custom themes.
  - vardoc_theme
distribution:
  name: Vardoc
  install:
    theme: vartheme_claro
 No newline at end of file