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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node.titlepatch | 546 bytes | adixon |
| titleb4form.patch.txt | 575 bytes | adixon |
Comments
Comment #1
magico commentedThis 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.
Comment #2
adixon commentedokay, thanks - the new patch has been updated to cvs, now labelled a bug.
Comment #3
beginner commentedYes. Simple enough.
Comment #4
drummCommitted to HEAD.
Comment #5
drummActually, 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.
Comment #6
magico commented@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.
Comment #7
beginner commentedIt's been committed:
http://drupal.org/cvs?commit=39931
Comment #8
(not verified) commented