I just switched two rows (1731, 1732) in node.module because I wanted to set the node form's page title while I was themeing the form, it seems like the right place to do it. In the current node.module, because the drupal_set_title comes after calling node_form, it gets overridden. Patch attached for convenience....

And why would I want to change the title? And why not do it as part of a localization trick? In this case, it's part of my use of og - in the context of submitting content as part of an organic group, the client wanted the page title to reflect this. The other place to do it would be at the point of theming the page as a whole, but it makes more sense from a themeing perspective to do it in the same place where I'm theming the form itself.

CommentFileSizeAuthor
#2 node.titlepatch546 bytesadixon
titleb4form.patch.txt575 bytesadixon

Comments

magico’s picture

Version: 4.7.2 » x.y.z
Status: Needs review » Needs work

This feature changes the order in the node_add() function.

By rule drupal_set_title() should *ALWAYS* came before any theme function, to allow theme developers to override all titles!

Patch need work to be applied to the HEAD.

adixon’s picture

Category: feature » bug
Status: Needs work » Needs review
StatusFileSize
new546 bytes

okay, thanks - the new patch has been updated to cvs, now labelled a bug.

beginner’s picture

Status: Needs review » Reviewed & tested by the community

Yes. Simple enough.

drumm’s picture

Committed to HEAD.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Actually, I do not support this general pattern.

These can be renamed via the menu. Page titles and other content are not the responsibility of themes. Themes exist to take the content provided and display it.

I'll leave the code as-is.

magico’s picture

Status: Fixed » Active

@drumm: I think you are wrong here.

A theme developer usually overrides many theme functions to provide new ways to format content.

The concept behind the idea that a theme developer will develop a theme to work with all modules, all configurations, all blocks, all everything is wrong.

Sure, that there are some themes (mainly for portals, or such) that must be worked on a way that can be switched and re-used without limitations, but most of the time a theme developer will stay in their folder working with their files.

This means that a theme developer will rarelly go to the site administration configure things that change the way (or things) that only refer to how the theme will show things. It's much easier (and simple) to do all theme related things in the theme files.

With all this, if it's not complicated to change the order of those lines of code, and that the change will provide a way to a theme developer do their work without more complication, why would we not do that?

Themes exist to take the content provided and format it according to the theme specifications. And the page title is just one more piece of that content.

I request at least a few minutes thinking about this, and not leaving the code as-is.

beginner’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)