"default settings" override node specific settings

epimeth - February 27, 2009 - 22:49
Project:Page Title
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:by design
Description

in the "default settings" page /admin/content/page_title
I place a value in the field for "Pattern for Page".
I then go to any node of type "Page" and see the title I entered - great!

Then I edit one of the nodes and in the "Page title:" field I enter some other text.
I go to view the page and the title remains the same as the one I entered in "default settings - pattern for Page".
Only when I remove what I entered in "Pattern for Page" does the text I entered in "Page title" appear.

#1

nicholasThompson - April 14, 2009 - 16:35
Component:Code» User interface
Category:bug report» support request
Priority:normal» minor
Status:active» postponed (maintainer needs more info)

What did you put in the Pattern For Page? Did it contain [page-title] or [title]?

#2

aether - November 27, 2009 - 18:16
Version:6.x-2.0» 6.x-2.x-dev
Component:User interface» Code
Category:support request» bug report
Priority:minor» normal
Status:postponed (maintainer needs more info)» needs review

I'm not sure if this is a bug or by design, but the behavior I expect here would be for page titles set at the individual node level to override the defaults set in the admin settings. Currently this does not happen if there is a default set for a particular node type. The issue occurs in the page_title_page_get_title() function. The attached patch against 6.x-2.x-dev is an attempt to fix this.

Note: This patch is only for the "node" scope within the aforementioned function as I do not have occasion to test the other scopes at the moment. I assume patching the other scopes would be as trivial as this patch. I can look into this when I have time but that won't be for at least a couple of weeks.

AttachmentSize
page_title_override.patch 839 bytes

#3

nicholasThompson - December 2, 2009 - 12:41
Status:needs review» by design

There are two parts to Page Title.

  1. The pattern. Page title will try to get a pattern for a specific node type (or term's vocab, etc.). If it cannot find one, it will fall back to the value in the default box. This technique allows one general pattern (the default) and the ability to override this default pattern on a per node-type basis (or per term-vocab.. depending on the scope).
  2. The Page Title. Page Title will try to load an overriding Page Title value on a per "object" basis. If the scope appears to be a node, it will try to get the overriding Page Title for that node. If there is no overriding Page Title value for the scope, then it will use the Node's title instead. This is why it is important to configure your patterns properly. If you configure your per node-type pattern to just use [title], then you will not be able to override using the Page Title field as the Token module will only be looking at the Node Title. You *must* use the [page-title] token if you want the ability to override. This is a special token provided by the Page Title module which will use the value of the Page Title field (if specified) but fall back to just the object title if no overriding value is available.

I hope this provides some clarity.

 
 

Drupal is a registered trademark of Dries Buytaert.