In a fresh installation of d7, when enabling and setting the Seven theme, the site name disappears of front page when an article is promoted to front.
When no article is promoted, the site name appears such as "Welcome to $site_name" under the toolbar.
Steps to reproduce the bug :
1. Create an article
2. Promote it to front page
Expected :
"Welcome to $site_name" under the toolbar inside a h1 tag.
Instead :
The site name does not appear, there's even no h1 tag at all. When the article is demoted from frontpage, the site is back where and how it should.
Hint from the code :
In the page.tpl.php of the Seven theme, there is
<?php if ($title): ?>
<h1 class="page-title"><?php print $title; ?></h1>
<?php endif; ?>
If I remove the if statement and leave only the line with the h1 tag, when the bug occurs the h1 appears but gets empty. So the problem may come from how the $title variable is populated, but I can't find where...
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | seven-page-title-891560_4.patch | 767 bytes | wapnik |
| #4 | seven-page-title-891560_3.patch | 911 bytes | Jeff Burnz |
| #2 | seven-page-title-891560_2.patch | 780 bytes | Jeff Burnz |
| #1 | seven-page-title-891560.patch | 973 bytes | wapnik |
Comments
Comment #1
wapnik commentedinspired by bartik and zen themes
Comment #2
Jeff Burnz commentedGood start but this implies that by toggling the site name off in theme settings it will nuke the page title, which is unexpected result.
Maybe something like this patch:
Comment #4
Jeff Burnz commentedOps...
I think this might need an rdfa review for semantics - not sure about wrapping the site name in the $title_prefix, $title_suffix stuff?
Comment #6
Jeff Burnz commentedok, so no idea what is going here, dam you bot...
Comment #7
wapnik commentedYes agree, bad inspiration in my case, these themes works quite a bit different.
Problem with your patch seems to be line-endings. Trying it again.
These $title_prefix, $title_suffix, are they intended to be displayed if there will be no title displayed? I mean shouldn't they go inside the condition? The same question for all the other themes.
Comment #8
wapnik commentedComment #9
Jeff Burnz commentedI spoke with some rdfa peeps yesterday and popped the same question about the prefix/suffix being outside the condition, apparently thats how its meant to work. Will check my line endings, weird cause I just posted like 20 other patches in the last day or so and no issues, grrrrr....
Comment #10
DjebbZ commentedI found why there was no site name as page title (h1). In node.module, in the function node_page_default() there is :
Basically if there is one or more node to load, the function empties the $title variable. So normally the theme takes care of displaying a h1 tag with something in it. And as the Seven theme doesn't by design, the "header" gets empty. If I understand the philosophy of the Seven theme, it's because it's an administration theme only.
The changes you made in the page.tpl.php changes this design, but it's not a bad idea to have something always appearing in this "header" region, like the site name.
Comment #11
reglogge commentedI don't really see the point here at all. Seven is explicitly declared as an administration theme - it's not intended to be the default theme for a website.
In this light, the described behavior makes sense and is not buggy at all. Seven displays page titles correctly when used as it is meant to be used.
While the patch in #7 works, I'm afraid were opening a can of worms here with more issues popping up trying to adapt Seven to a task (being a site's default theme) it's explicitly not meant to fulfill.
Comment #12
Jeff Burnz commentedYep, I actually agree with this, if a user really wants to use Seven as the front end theme they can always subtheme it and add this themselves.