From b61f0ae5c04c73e8a7da7b3726b45ce6a60665eb Mon Sep 17 00:00:00 2001 From: zymphonies-dev <shanz@zymphonies.com> Date: Tue, 9 Jan 2024 21:34:43 +0300 Subject: [PATCH] Drupal 10 changes --- css/custom-style.css | 7 ++++--- drupal8_custom_theme.info.yml | 7 +++---- drupal8_custom_theme.libraries.yml | 4 ++-- drupal8_custom_theme.theme | 12 ++++++------ js/custom.js | 5 +++-- templates/content/comment.html.twig | 4 ++-- templates/content/node.html.twig | 2 +- templates/misc/status-messages.html.twig | 2 +- templates/navigation/book-navigation.html.twig | 2 +- templates/navigation/toolbar.html.twig | 4 ++-- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/css/custom-style.css b/css/custom-style.css index 564c99e..77ca7be 100644 --- a/css/custom-style.css +++ b/css/custom-style.css @@ -3,10 +3,11 @@ /* --------------------------------------------- * Filename: custom-style.css * Version: 1.0.0 (2016-08-06) -* Website: http://www.zymphonies.com + 1.0.2 (2024-01-09) +* Website: https://www.zymphonies.com * Description: Global Styles -* Author: Zymphonies Support Team - support@zymphonies.com +* Author: Zymphonies Team + info@zymphonies.com -----------------------------------------------*/ body{ diff --git a/drupal8_custom_theme.info.yml b/drupal8_custom_theme.info.yml index 8835cfc..0a94768 100644 --- a/drupal8_custom_theme.info.yml +++ b/drupal8_custom_theme.info.yml @@ -1,10 +1,9 @@ -name: Drupal 8 Custom Theme +name: Drupal 8/9/10 Custom Theme type: theme -description: 'Designed & Developed by <a href=http://www.zymphonies.com>Zymphonies</a><br/>Contact us for any kind of Drupal services <a href=mailto:info@zymphonies.com>info@zymphonies.com</a>' +description: 'Designed & Developed by <a href=https://www.zymphonies.com>Zymphonies</a><br/>Contact us for any kind of Drupal services <a href=mailto:info@zymphonies.com>info@zymphonies.com</a>' package: core base theme: false -core: 8.x -core_version_requirement: ^8 || ^9 +core_version_requirement: ^8 || ^9 || ^10 #Libraries libraries: diff --git a/drupal8_custom_theme.libraries.yml b/drupal8_custom_theme.libraries.yml index d763f3b..1171810 100644 --- a/drupal8_custom_theme.libraries.yml +++ b/drupal8_custom_theme.libraries.yml @@ -10,7 +10,7 @@ bootstrap: - core/drupal.ajax - core/drupal - core/drupalSettings - - core/jquery.once + - core/once global-components: Version: 1.x @@ -29,7 +29,7 @@ global-components: - core/drupal.ajax - core/drupal - core/drupalSettings - - core/jquery.once + - core/once flexslider: version: 1.x diff --git a/drupal8_custom_theme.theme b/drupal8_custom_theme.theme index f677aea..0cc0124 100644 --- a/drupal8_custom_theme.theme +++ b/drupal8_custom_theme.theme @@ -13,7 +13,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\system\Form\ThemeSettingsForm; use Drupal\file\Entity\File; use Drupal\Core\Url; -use Drupal\file\Plugin\Core\Entity\FileInterface; +use Drupal\file\FileInterface; /** * Implements hook_preprocess_page() for block templates. @@ -91,8 +91,8 @@ function drupal8_custom_theme_preprocess_page(&$variables) { //To get the current URL $current_url = \Drupal::request()->getRequestUri(); - $current_path = explode("/", $current_url); - $variables['current_path'] = $current_path[2]; + $current_path = parse_url($current_url); + $variables['current_path'] = $current_path['path']; // Assign Variable for Slider if ($variables['is_front']) { @@ -133,10 +133,10 @@ function drupal8_custom_theme_get_slider_content() { if (!empty($fid)) { $file = File::load($fid[0]); $uri = $file->getFileUri(); - $path = file_create_url($uri); + $path = \Drupal::service('file_url_generator')->generateAbsoluteString($uri); } else { - $path = base_path() . drupal_get_path('theme', 'drupal8_custom_theme') . theme_get_setting('slide_image_path_' . $i, 'drupal8_custom_theme'); + $path = base_path() . \Drupal::service('extension.list.theme')->getPath('drupal8_custom_theme') . theme_get_setting('slide_image_path_' . $i, 'drupal8_custom_theme'); } $slider_content[$i] = '<li> <img src="' . $path . '" alt="Slider Banner" /> @@ -262,7 +262,7 @@ function drupal8_custom_theme_form_system_theme_settings_alter(&$form, FormState $image = theme_get_setting('slide_image_path'.$i,'drupal8_custom_theme'); if(!empty($image)){ $file = File::load($image[0]); - $file->status = FILE_STATUS_PERMANENT; + $file->setPermanent(); $file->save(); $file_usage = \Drupal::service('file.usage'); $file_usage_check = $file_usage->listUsage($file); diff --git a/js/custom.js b/js/custom.js index a251a2e..6155331 100644 --- a/js/custom.js +++ b/js/custom.js @@ -1,9 +1,10 @@ /* --------------------------------------------- * Filename: custom.js * Version: 1.0.0 (2016-08-06) -* Website: http://www.zymphonies.com + 1.0.2 (2024-01-09) +* Website: https://www.zymphonies.com * Description: Global Script -* Author: Zymphonies Support Team +* Author: Zymphonies Team support@zymphonies.com -----------------------------------------------*/ diff --git a/templates/content/comment.html.twig b/templates/content/comment.html.twig index d80c905..041cbe9 100644 --- a/templates/content/comment.html.twig +++ b/templates/content/comment.html.twig @@ -64,9 +64,9 @@ * @see template_preprocess_comment() */ #} -{% if threaded %} +{# {% if threaded %} {{ attach_library('classy/indented') }} -{% endif %} +{% endif %} #} {% set classes = [ 'comment', diff --git a/templates/content/node.html.twig b/templates/content/node.html.twig index 756cd32..a1e3481 100644 --- a/templates/content/node.html.twig +++ b/templates/content/node.html.twig @@ -73,7 +73,7 @@ view_mode ? 'node--view-mode-' ~ view_mode|clean_class, ] %} -{{ attach_library('classy/node') }} +{# {{ attach_library('classy/node') }} #} <article{{ attributes.addClass(classes) }}> {{ title_prefix }} diff --git a/templates/misc/status-messages.html.twig b/templates/misc/status-messages.html.twig index da56bcc..6f4270d 100644 --- a/templates/misc/status-messages.html.twig +++ b/templates/misc/status-messages.html.twig @@ -23,7 +23,7 @@ * @see template_preprocess_status_messages() */ #} -{{ attach_library('classy/messages') }} +{# {{ attach_library('classy/messages') }} #} {% block messages %} {% for type, messages in message_list %} {% diff --git a/templates/navigation/book-navigation.html.twig b/templates/navigation/book-navigation.html.twig index 8a34c91..19b6eb2 100644 --- a/templates/navigation/book-navigation.html.twig +++ b/templates/navigation/book-navigation.html.twig @@ -28,7 +28,7 @@ * @see template_preprocess_book_navigation() */ #} -{{ attach_library('classy/book-navigation') }} +{# {{ attach_library('classy/book-navigation') }} #} {% if tree or has_links %} <nav id="book-navigation-{{ book_id }}" class="book-navigation" role="navigation" aria-labelledby="book-label-{{ book_id }}"> {{ tree }} diff --git a/templates/navigation/toolbar.html.twig b/templates/navigation/toolbar.html.twig index 20f12d4..5ef3ffa 100644 --- a/templates/navigation/toolbar.html.twig +++ b/templates/navigation/toolbar.html.twig @@ -27,7 +27,7 @@ {% set tray = trays[key] %} <div{{ tab.attributes.addClass('toolbar-tab') }}> {{ tab.link }} - {% spaceless %} + {% apply spaceless %} <div{{ tray.attributes }}> {% if tray.label %} <nav class="toolbar-lining clearfix" role="navigation" aria-label="{{ tray.label }}"> @@ -38,7 +38,7 @@ {{ tray.links }} </nav> </div> - {% endspaceless %} + {% endapply %} </div> {% endfor %} </nav> -- GitLab