Within the Drupal 8's page.tpl.php, the site slogan should use an h2 instead of a paragraph tag when rendered. I have included code which makes the presentation more semantic, but I am sure the logic could be simplified some. I have included a patch and the following code modifies the existing block of code which handles slogan/site name.

          <?php if ($site_name || $site_slogan): ?>
            <?php if ($title && $site_name && $site_slogan): ?>
              <div id="site-name"><strong>
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
              </strong></div>
			  <div id="site-slogan"><?php print $site_slogan; ?></div>
			<?php elseif($title && $site_name): /* Use div when the content title is not empty and site name exists */ ?>
			  <div id="site-name"><strong>
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
              </strong></div>
			<?php elseif($title && $site_slogan): /* Use div when the content title is not empty and slogan exists */ ?>
			  <div id="site-slogan"><?php print $site_slogan; ?></div>
            <?php elseif($site_slogan && $site_name): /* Use hgroup when the content title is empty and slogan and site name exists */ ?>
              <hgroup>  
			    <h1 id="site-name">
                  <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
                </h1>
				<h2 id="site-slogan"><?php print $site_slogan; ?></h2>
			  </hgroup>
			<?php elseif($site_slogan): /* Use h2 when the content title is empty and slogan exists */ ?>
			<h2 id="site-slogan"><?php print $site_slogan; ?></h2>
            <?php endif; ?>
          <?php endif; ?>

Comments

ron williams’s picture

StatusFileSize
new2.16 KB

Correct patch.

tlattimore’s picture

Status: Active » Needs review
StatusFileSize
new2.24 KB

I also have thought the the putting the site slogan inside a paragraph was incorrect.

The patch in comment #1 doesn't look like it was done using the standard git diff format for creating patches(see http://drupal.org/node/707484), it also had some excessive spaces at the end of a couple lines. I have resolved this and re-rolled the patch.

Status: Needs review » Needs work

The last submitted patch, sitetitle-slogan-hgroup-1492638.patch, failed testing.

droplet’s picture

Status: Needs work » Postponed

Based on the reason why don't use it #1077578: [Followup] Convert bartiks page.tpl.php to HTML5. It's too early to reintroduce it into core.

ron williams’s picture

Status: Postponed » Active

Can you provide some additional details on the issue with implementing these tags? I did not see further reasons except notices regarding changes in core. A link to the comment where the issue is raised with the commit?

David_Rothstein’s picture

I think it's in reference to this comment - #1077578-13: [Followup] Convert bartiks page.tpl.php to HTML5? ... which suggests that <hgroup> might be removed from HTML5. I haven't followed all the recent HTML5 politics around this but I guess the idea is we should make sure the tag is staying before we start adding it to Drupal 8?

In any case, I took a quick look at the patch itself, and it looks good but it does seem like some of the logic could probably be simplified. For example:

       <?php if ($site_name || $site_slogan): ?>
         <div id="name-and-slogan">
-          <?php if ($site_name): ?>
-            <?php if ($title): ?>
-              <p id="site-name"><strong>
+          <?php if ($site_name || $site_slogan): ?>

I don't think we need the same if() statement (at the top and bottom) repeated twice?

I also saw a couple small code style issues - for example, a double space should be used to indent (rather than a tab).

David_Rothstein’s picture

Status: Active » Needs work

Moving to "needs work" for now, since there is a patch.

lauriii’s picture

Component: theme system » Classy theme

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

davidhernandez’s picture

Component: Classy theme » Stable theme

Moving this to Stable. We may be able to make this change in core now, but will need BC. It probably can't be changed at all in Classy.

joginderpc’s picture

Issue tags: +file not exist page.tpl.php

I had tested the patch but on same path the file does not exist now.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Closed (outdated)
Issue tags: -file not exist page.tpl.php

Thanks for making this issue and for working on a patch. The file page.tbl.php is no longer in core and the Stable theme has been removed from core. I think it is time to close this as outdated.