Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have upgraded my development site to the latest Panopoly release and now my page titles includes the site name. The daftest example is the contact form, which now has the title "Contact us | sitename". I've played with various options in my panels content settings, even tried the Page Title module (I see there are issues for it here so not surprised that hasn't worked). I find it hard to imagine it's an issue (hence not categorised as a bug) so any suggestions for what I've (unwittingly) done wrong?
Comments
Comment #1
dsnopekHm. As far as I can think of, I don't think we changed anything in Panopoly that messes with page titles. Panelizer affects node title, but we haven't updated it yet.
Looking at the Drupal 7.38 code, it appears that
template_preprocess_html()
in includes/theme.inc does this. According togit blame
it's been this way for a long, long time. :-)In your own module or theme, you could definitely implement your own
hook_preprocess_html(&$vars)
and do$vars['head_title'] = drupal_get_title();
? That should make the page title only be the page title and not include the site name.I hope that helps!
Comment #2
PedroKTFC CreditAttribution: PedroKTFC commentedThanks for getting back. I think I may not have understood the terminology fully myself. The page title, as in the title metatag, is probably correct (frankly, I'm not too bothered about that). It's the title of a page as specified in the content part of a panel (I've tried overwriting with %title to no avail). In older versions, this would correctly show things like "Contact us", "Blog", "About us"; some are node titles, some are not but none had the sitename in them. Newer versions add the sitename for me (and I'm using a modified version of the responsive Bartik, nothing fancy).
I'll look at your suggestion and report back for completeness.
Comment #3
dsnopekOh, so this is the node title! That should be set by Panelizer. I've definitely never seen this on any other Panopoly site, so I suspect that some additional module is interfering...
Comment #5
PedroKTFC CreditAttribution: PedroKTFC commentedI came back to look at this again this week and finally sorted it. Thought I'd post it here as it's a bit obscure (and no idea how I did it in the first place) in case it ever happens to anyone else.
Go to Home » Administration » Structure » Panels » Settings » Panels, choose the "Everywhere" tab and in the section HEAD TITLE, the "Include the site name" option controls whether the site name is included in the title.
Phew!
[Update: some module is update is changing this setting. I don't know which but when I upgraded my sites they all reset with this setting.]
Comment #6
PedroKTFC CreditAttribution: PedroKTFC commentedComment #7
markh_ CreditAttribution: markh_ commentedThanks for the tip PedroKTFC. I spent the last hour trying to figure out why the site name was appearing in the panel title and then I came across your post.