What it says up there! ^ :)

I guess it would be a fairly simple procedure (for someone else, who had a clue) to add the functionality to enable editing of the page title on a per node type basis? i.e, can we switch off page title editing for certain node types?

I know that page titles default to node titles if they are blank, but it might be a nice feature to actually switch this off under ertain circumstances - eg I have a CCK type which is basically just a link, a title and some other basic info. It really doesn't need to have an optimised page title, and in light of that, there's little point in presenting the user with the option to change it, for usability reasons as much as anything.

I'm slightly uncertain if I'm going the right way about this - might it be possible to expose this functionality from another angle, ie through CCK configuration and permissions?

CommentFileSizeAuthor
#1 page_title.module_4.patch1.86 KBjaydub

Comments

jaydub’s picture

Version: 5.x-1.x-dev » 4.7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.86 KB

Ok this patch is for 4.7.x but since my changes are in regards to this topic I am posting here. As an aside, this patch also includes a function added to the API section to be able to set a node's page title from another module. Right now you can only get the page title.

Feel free to use or discard bits of the patch as needed.

johnalbin’s picture

Title: Enable page title on a per node type basis » Disable page title based on content type
Status: Needs review » Needs work

The previous title of this issue didn’t do the request justice. It’s actually a quite useful feature request.

The above patch would disable all content-types by default. But the default should be that all content-types are enabled. Also, “Included content types” should really be “Disable page_title for the following content types”

nicholasthompson’s picture

This is actually on my "to do" list. I have a basic dev version on my dev box. Once I got it working properly, it will get commited into the dev branch. Once that's confirmed ok I'll promote it to the final release.

niklp’s picture

Actually, further to my initial comment, it might be nice to have a config option thus:

[checkbox] Automatically fill this page title with the node title?

That is, rather than presenting the user with the option to change the page title (as per initial comment), should we override the existing page title and render it as per the page_title settings? Unless this is what it does anyway. It's sunday, I'm tired.

nicholasthompson’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

Interesting... so per-content-type we can provide 3 options:
1) Do nothing. Just let Drupal handle it in the default way.
2) Don't allow the user to override the actual page title itself, but control the page title using the token layout in the configuration.
3) Allow the user to override the page title separately to the node title + apply that page title using the tokens in the configuration.

That could be done nicely using 3 horizontally laid out radio buttons per content type.

Thoughts?

I'm moving this to a 5.x feature as it will be easier to backport it to 4.7 once 5.x is done.

johnalbin’s picture

Title: Disable page title based on content type » Hide page title text box based on content type

My previous comments are in need of revision.

Nicholas, we should eliminate the #1 option on your list. I don’t think anyone would really need to actually disable page_title per content; they just want to hide the Page title text box to streamline the edit/add page for certain node types.

So the settings page should have a fieldset of checkboxes like this:

Hide “Page title” option when adding/editing the following content types:
 [ ] Image
 [ ] Page
 [ ] Story

So for content types that have been checked we will use the token configuration on the page_title settings administration.

For me, this would eliminate the conversation I have with clients: “Just ignore the Page title text box when you add an Image.” :-)

nicholasthompson’s picture

That would work - however the page title for an image will still be "calculated" based on the token settings. Will there ever be a case where this is undersirable (eg if a module provides a type which controls its own title?)

niklp’s picture

I think:

Enable Page Title (implicitly, "dynamic construction of p_t") for these content types:
[ ] type 1
[ ] type 2
[ ] type 3

Then in each content type, have a set of options:
[ ] use default token arrangement to construct page title (shows no p_t field)
[ ] show p_t field on individual node edit pages

I think there is potentially a case where no p_t involvement is needed - the above arrangement deals with this, whilst also removing that extra "choice" for the administrator. Maybe this would be the case if e.g. the FAQ module started offering it's own page title by node title, or some such - then there would be no need to offer p_t involvement to those nodes (FAQ is a module that creates its own content type).

Thoughts?

johnalbin’s picture

I think there is potentially a case where no p_t involvement is needed

When? If a user installs page_title they want to override Drupal's default “node title | site name” page title. When would reverting to the standard for only certain content types would be useful?

Instead of enabling/disabling by content type, maybe we need page title patterns for each content type.

johnalbin’s picture

Assigned: Unassigned » johnalbin
Status: Needs work » Fixed

There is now a working version of this feature in HEAD. It will be included in the forthcoming 5.x-2.0 version of Page title.

The new feature follows the functionality described in comment #6 above. I believe that the extra options described in comment #8 will be mitigated once “Allow different settings for each content type” (issue #158110) is completed.

johnalbin’s picture

Those itching to see this can now download 5.x-2.x-dev: http://drupal.org/node/164405

johnalbin’s picture

Version: 5.x-1.x-dev » 5.x-2.x-dev
Anonymous’s picture

Status: Fixed » Closed (fixed)