Blocky is a copy of the Core stable theme with a number of templates marked up with Twig Blocks formatting.

The Twig Blocks allow themes that use Blocky as a replacement base theme for Stable (the de-facto. default base theme) to override those marked up templates overriding just targeted sections of code (read Twig extends for further understanding).

Although potentially useful in its' own right I also envisage Blocky being copied and extended in custom base themes to meet peoples needs and as a demonstration of how Twig Extends can be used in alternative Drupal frontend work-flows.

To my knowledge there are no other base themes for Drupal 8 aimed at aiding/demonstrating Twig extends.

Git clone: git clone --branch 8.x-1.x https://git.drupal.org/sandbox/chris_hall_hu_cheng/2646294.git blocky

Project page: Blocky base theme.

Comments

chris_hall_hu_cheng created an issue. See original summary.

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxchris_hall_hu_cheng26...

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

chris_hall_hu_cheng’s picture

@PA robot
Regarding the automatic review script, I did run that myself, a large number of css, line endings, line length etc. points were raised.

Note that this theme starts from a copy of the Core Stable theme however all those files are exactly as in Stable, spending time tidying those would defeat the object of one of the use-cases of Stable (an easy starting point for modified base themes) and also into the possibility of errors.

Putting this back to needs review on that basis as I don't believe I need to do anything on basis of the automated review.

chris_hall_hu_cheng’s picture

Status: Needs work » Needs review
rainbowarray’s picture

Status: Needs review » Needs work

Automated Review

In this case, the automated review findings are not terribly useful, since the errors reported are for files that are copied directly from core.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.

Solid profile, Christopher!

No duplication
No: Causes theme duplication and/or fragmentation.

I think this is a great concept for theme. Twig blocks rock, and it's great to see a cool demonstration for how to make use of Twig blocks. That said, I don't see why this theme needs to be a duplication of the Stable theme. You're copying all of the CSS and images in Stable, and then overriding core with your versions of those files, but since I don't think you're doing anything different with the CSS and images, that seems like a lot of unnecessary duplication. If I missed something, and there's a good reason for that, glad to know.

However it seems like a simpler solution would be to set Stable as the base theme for Blocky, and then override only the templates where you want to demonstrate Twig blocks. That would make it much more clear what your particular theme is doing versus what Stable does in core in terms of providing a BC layer.

Master Branch
Yes: Follows the guidelines for master branch.

8.x-1.x: check!

Licensing
Yes: Follows the licensing requirements.

I don't see any third-party code or licensing problems with the theme.

3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.

No third-party assets or code. All good here.

README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.

This seems generally okay. The project page lists which templates now have Twig blocks, which is handy and could be useful in the README. That wouldn't be necessary if Blocky extended Stable and the theme only had the templates that now used Twig blocks. The Twig blocks in the templates don't have code comments, but they're pretty self-explanatory given the block names. Not sure that adding code comments for those would be particularly helpful. So this seems pretty solid.

Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.

In reality the unique code for this is the templates with Twig blocks. Everything else is copied and modified as needed from Stable. Those templates do have a sufficient amount of code to review.

Secure code
Yes: Meets the security requirements.

The templates are really the primary code for review here, and I don't see anything in the Twig files that looks like an issue.

Coding style & Drupal API usage
I don't really see any coding issues, per se. But I do think this project would be vastly improved and much easier to manually review if the theme extended Stable. If there's a really, really good reason not to do that, that's worth considering. But this is going to be much easier to maintain and understand if it isn't duplicating so much of Stable.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

Final note: Interesting theme! And I do think it is worth considering this for core as well. Hope you can trim this theme down to its essence, as it's a very interesting demo of the power of Twig blocks.

chris_hall_hu_cheng’s picture

@mdrummond Thanks for such a comprehensive review.

Actually now you mention it it is kind of obvious to use Stable as the base for blocky, I agree with everything you have said, and rework to something a lot smaller with just the overriding templates :)

Chris

chris_hall_hu_cheng’s picture

Status: Needs work » Needs review

I have taken onboard the sensible suggestions of @mdrummond and changed the theme to sub-theme Stable and just include the overridden templates.

chris_hall_hu_cheng’s picture

ericpugh’s picture

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause theme duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity. This theme is obviously very simple and probably does not meet the "complexity" guidelines of a module, however I feel like the intent has potential and deserves to be a full project. That being said, are there more templates from Stable that could be overriden in Blocky?
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. I'd recommend adding a simple composer.json file to define this project as a "theme". This is esp. helpful for people using things like the drupal-composer/drupal-project
  2. Add a default Blocky logo? I'm getting a 404: Logo not found /themes/contrib/blocky/logo.svg
  3. There's a small typo in the project page documentation, the example code block should extend "node.html.twig" not "node.twig.html"
  4. I realize this is an incredibly minimal project, but since it's meant to be used as a base theme, I think it'd be better with a starterkit. The starterkit might even include some example overriden templates, using extends (or embed or include or whatever, as discussed in your post)

This review uses the Project Application Review Template.

Hope that's helpful.

chris_hall_hu_cheng’s picture

@ericpugh, thanks for the review :)

Will correct the typo and good call on the composer.json file, just started using composer (as replacement for Drush make) with D8.

Regarding the logo. stable doesn't have one, so I don't think this theme should either. I guess you had site branding block placed. My aim is to make it work exactly the same as Stable (with the ability to override Twig blocks).

Re the StarterKit, not sure that is appropriate. Both Stable and Classy provide consistent base themes allowing Drupal core to carry on evolving markup without breaking existing themes. Blocky is supposed to be a drop in replacement for stable with Twig block markup, not really a Starter theme like Omega or Bootstrap theme. Also extends (and any experiments with embed, include etc.) start making sense once you have new content types etc. I am working on an example that uses Blocky as a base for a Revealjs theme and Drupal content management for the slides (this would be standalone though). I will update the documentation to explain the intentions a little more clearly.

Agreed, about the templates, tend to be overriding as needed, some of the views templates are probably useful candidates for block markup for sure.

hesnvabr’s picture

You create a following files in your theme:-
html.twig.html
page.twig.html
node.twig.html
block.twig.html
comment.twig.html
search_result.twig.html

I think you forget to create block.liberaries.yml file.This file is necessary in D8 theme.

chris_hall_hu_cheng’s picture

@pranavbabbar this theme has the core Stable theme as its' sub-theme so only needs to override selected files, everything else will come from Stable.

chris_hall_hu_cheng’s picture

I have added a composer.json (as suggested by @ericpugh) and also a License.

Binu Varghese’s picture

Status: Needs review » Needs work

As part of Project application checklist - https://www.drupal.org/node/1587704

It says - under section 4. Licensing checks
4.1 Ensure the top directory of the repository does not contain a ‘LICENSE.txt’ (or similar) file.
"Do not include a LICENSE.txt file in your repository. Drupal.org will add the appropriate version automatically during packaging."

Please remove it from your repository.

klausi’s picture

Status: Needs work » Needs review

The license file says GPLv2+, so that is the same as on drupal.org. Removing the license file is surely not an application blocker, anything else that you found or should this be RTBC instead?

Binu Varghese’s picture

Status: Needs review » Reviewed & tested by the community

looks RTBC to me then..

mlncn’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, chris_hall_hu_cheng! You are now a vetted Git user. You can promote this to a full project.

When you create new projects (typically as a sandbox to start) you can then promote them to a full project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process, especially my slowness in approving following review. We know it's broken and are trying to fix it.

Status: Fixed » Closed (fixed)

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