In order for Zen to register as a Drupal 8 theme, we must port the .info theme code from D7 to the appropriate YAML standards for D8.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JohnAlbin’s picture

jamessw’s picture

FileSize
14.43 KB

Here's a patch including the starter kit. At this point, you can enable Zen as the default theme, but it's not themed.

jamessw’s picture

(Deleted-duplicate entry)

mkostrzewa’s picture

  1. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# Drupal's .info files allow themers to easily specify some of the static
    

    Should .info be .info.yml?

  2. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# properties of your theme. Properties such as its name, stylesheets,
    

    This may need to be reworded to make it clear to the user that asset libraries are declared not JS and CSS files themselves.

  3. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# Drupal 8 stores a cache of the data in this .info files. If you modify any
    

    Again, .info.yml

  4. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# This theme is compatible with Drupal 7 core. And it is a sub-theme of Zen.
    

    Should this be Drupal 8 core?

  5. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# - Remove a module's stylesheet. If you specify the name of a Drupal core or
    

    This may not be applicable anymore as we are using 'stylesheets-remove'?

  6. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# This section lists the regions defined in Zen's default page.tpl.php and
    +# maintenance-page.tpl.php files. The name in brackets is the machine name of
    +# the region. The text after the equals sign is a descriptive text used on the
    +# admin/structure/blocks page.
    ...
    +# In the page.tpl, the contents of the region are output with a
    +# $page['MACHINE-NAME'] variable and, in the maintenance-page.tpl, the region is
    +# output with a $MACHINE-NAME variable. For example, with this line in the .info
    +# file:
    +#   regions[header_top]: Header top
    +# You'll use this variable in page.tpl.php:
    +#   <?php print render($page['header_top']); ?>
    +# And you'll use this variable in maintenance-page.tpl.php:
    +#   <?php print $header_top; ?>
    

    This needs to be replaced with D8 specific info e.g .php.tpl files need to be twig.html and the php template syntax needs to be replaced with Twig's syntax.

  7. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# Various page elements output by the theme can be toggled on and off. The
    +# "features" control which of these check boxes display on the
    +# admin/appearance config page. This is useful for suppressing check boxes
    +# for elements not used by your sub-theme. To suppress a check box, omit the
    +# entry for it below. See the Drupal 7 Theme Guide for more info:
    +# https://drupal.org/node/171205#features
    +features:
    +  - logo
    +  - name
    +  - slogan
    +  - node_user_picture
    +  - comment_user_picture
    +  - favicon
    +  - main_menu
    +  - secondary_menu
    +
    +
    +
    +# Set the default values of settings on the theme-settings.php form.
    +
    +settings:
    +  zen_breadcrumb: 'yes'
    +  zen_breadcrumb_separator: ' › '
    +  zen_breadcrumb_home: '1'
    +  zen_breadcrumb_trailing: '0'
    +  zen_breadcrumb_title: '0'
    +  zen_layout: 'zen-responsive-sidebars'
    +  zen_skip_link_anchor: 'main-menu'
    +  zen_skip_link_text: 'Jump to navigation'
    +  zen_meta: ¶
    +    - 'html5'
    +    - 'meta'
    +  zen_rebuild_registry: '1'
    ...
    +#  shortcut_module_link: 1
    

    This may no longer be applicable to D8. See https://www.drupal.org/node/2382645#comment-10380143

  8. +++ b/STARTERKIT/STARTERKIT.libraries.yml.txt
    @@ -0,0 +1,16 @@
    +base:
    

    Should a version be added? https://www.drupal.org/theme-guide/8/assets
    Link to the documentation might be good too.

  9. +++ b/STARTERKIT/STARTERKIT.libraries.yml.txt
    @@ -0,0 +1,16 @@
    +#    js/script.js: {}
    

    Should there be a comment added regarding declaring jQuery as a dependency as it is no longer loaded by default on all pages?

  10. +++ b/zen.info.yml
    @@ -0,0 +1,44 @@
    +settings:
    

    As mentioned before, may not be applicable in D8 anymore.

jamessw’s picture

FileSize
14.43 KB

@mkostrzewa thanks for your checks! I fixed the typos, but I'd appreciate if someone with more understanding worked on the documentation and the D8 changes. I'm wondering if we should make another issue for documentation, to be completed when work on Zen for Drupal 8 is closer to done, and we have a better idea of what needs to be documented?

mkostrzewa’s picture

  1. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# This section lists the regions defined in Zen's default page.tpl.php and
    +# maintenance-page.tpl.php files. The name in brackets is the machine name of
    +# the region. The text after the equals sign is a descriptive text used on the
    +# admin/structure/blocks page.
    +#
    +# In the page.tpl, the contents of the region are output with a
    ...
    +# output with a $MACHINE-NAME variable. For example, with this line in the .info
    +# file:
    ...
    +# You'll use this variable in page.tpl.php:
    +#   <?php print render($page['header_top']); ?>
    +# And you'll use this variable in maintenance-page.tpl.php:
    +#   <?php print $header_top; ?>
    

    I assume this will be amended by the documentation person?

  2. +++ b/STARTERKIT/STARTERKIT.info.yml.txt
    @@ -0,0 +1,145 @@
    +# Various page elements output by the theme can be toggled on and off. The
    +# "features" control which of these check boxes display on the
    +# admin/appearance config page. This is useful for suppressing check boxes
    +# for elements not used by your sub-theme. To suppress a check box, omit the
    +# entry for it below. See the Drupal 7 Theme Guide for more info:
    +# https://drupal.org/node/171205#features
    +features:
    +  - logo
    +  - name
    +  - slogan
    +  - node_user_picture
    +  - comment_user_picture
    +  - favicon
    +  - main_menu
    +  - secondary_menu
    +
    +
    +
    +# Set the default values of settings on the theme-settings.php form.
    +
    +settings:
    +  zen_breadcrumb: 'yes'
    +  zen_breadcrumb_separator: ' › '
    +  zen_breadcrumb_home: '1'
    +  zen_breadcrumb_trailing: '0'
    +  zen_breadcrumb_title: '0'
    +  zen_layout: 'zen-responsive-sidebars'
    +  zen_skip_link_anchor: 'main-menu'
    +  zen_skip_link_text: 'Jump to navigation'
    +  zen_meta: ¶
    +    - 'html5'
    +    - 'meta'
    +  zen_rebuild_registry: '1'
    +  ¶
    +# To make this sub-theme an admin theme with shortcut links next to titles,
    +# uncomment the line below.
    +
    +#  shortcut_module_link: 1
    

    This needs to refactored for D8 please see https://www.drupal.org/node/2382645

  3. +++ b/zen.info.yml
    @@ -0,0 +1,44 @@
    +settings:
    +  zen_breadcrumb: 'yes'
    +  zen_breadcrumb_separator: ' › '
    +  zen_breadcrumb_home: '1'
    +  zen_breadcrumb_trailing: '0'
    +  zen_breadcrumb_title: '0'
    +  zen_layout: 'zen-responsive-sidebars'
    +  zen_skip_link_anchor: 'main-menu'
    +  zen_skip_link_text: 'Jump to navigation'
    +  zen_meta: ¶
    +    - 'html5'
    +    - 'meta'
    +  zen_rebuild_registry: '0'
    

    As mentioned above will need to be refactored for D8

mkostrzewa’s picture

@jamessw you're welcome. I added some comments to your latest patch. @JohnAlbin, should we add a ticket for documentation?

mkostrzewa’s picture

Status: Needs review » Needs work
kmonty’s picture

Title: Create yaml for the .info (Drupal 8) » Zen's .info and settings need to be migrated to YAML
Priority: Normal » Critical
Issue summary: View changes

Patch forthcoming.

kmonty’s picture

I have Zen core working on my local, but have not updating the STARTERKIT YAML files yet.

Note: I removed panels (it's not ready for D8) and registry rebuild (in core now, yay!) from the settings. Will open separate tickets about that.

mkostrzewa’s picture

Hi @kmonty, is that patch ready for review or are you adding another patch?

  • JohnAlbin committed ef16287 on 8.x-7.x authored by kmonty
    Issue #2487856 by jamessw, marthinal, kmonty, mkostrzewa, JohnAlbin: Zen...
JohnAlbin’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.