When I attempt to use amptheme (the base theme, not the subtheme) as the actual AMP theme for testing, the templates/layout/html.tpl.php and templates/layout/page.tpl.php are not being used properly. When I delete the ampsubtheme_example directory, everything works as expected!

This appears to be an issue with the fact that Drupal is discovering ampsubtheme_example/templates/layout/html.tpl.php *before* templates/layout/html.tpl.php, but doesn't respect that it's inside another theme, and not itself. Other themes like Omega have had to deal with this by placing each theme inside a root-level directory, instead of using subdirectories.

Worth investigating if this applies to Drupal 8 as well.

CommentFileSizeAuthor
#3 2717477-3-amp-theme-structure.patch58.91 KBrainbowarray

Comments

Dave Reid created an issue. See original summary.

dave reid’s picture

Seeing as drupal_find_theme_templates() still exists in 8.0.x - 8.2.x, I would wager D8 is affected by this too.

rainbowarray’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
StatusFileSize
new58.91 KB

Here is a patch that moves amptheme into a subdirectory in D8.

  • mdrummond committed bd2c18b on 8.x-1.x
    Issue #2717477 by mdrummond, Dave Reid: Errors using amptheme because...
rainbowarray’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev

Fixing D7 next.

  • mdrummond committed 8b304b5 on 7.x-1.x
    Issue #2717477 by mdrummond, Dave Reid: Fix errors with amptheme because...
rainbowarray’s picture

Status: Active » Fixed

All fixed now. Thanks so much for tracking this down, Dave!

Status: Fixed » Closed (fixed)

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