[DUG-TO] Custom node/add and node/edit page titles

Alan Dixon alan.g.dixon at gmail.com
Thu Dec 4 16:57:25 EST 2008


I think andre's suggestion is better - i.e. use the form theme hook.
Originally (i.e. 4.7) the forms processing set the title after
themeing, but I'm pretty sure it's fixed now.

I posted another option on the drupal forum post.

 - Alan

On Thu, Dec 4, 2008 at 1:37 PM, Khalid Baheyeldin <kb at 2bits.com> wrote:
> The following code should do what you intend.
>
> But, I am not sure if it will override the original path's title.
>
> If not, then perhaps add it to a hook_exit() so it is the last thing that
> happens.
>
> <?php
> if ($_GET['q'] == 'node/add/tomato') {
>   drupal_set_title(t('Throw a tomato at us ...'));
> }
> ?>
>
> On Thu, Dec 4, 2008 at 1:31 PM, Design Guru <subscriptions at designguru.org>
> wrote:
>>
>> *Also just posted at http://drupal.org/node/342750
>>
>> Hey all,
>>
>> I've been searching for days for an approach that actually works - its a
>> shame that this isn't a simple option when editing each node type from
>> the regular drupal admin side but...
>>
>> ...I'm looking for a snippet to throw into my template.php which will
>> let me specify a custom title atop a node submission/editing page per
>> content type; so instead of 'Create Tomato' I could specify say 'Throw a
>> tomato at us' when a user is looking @ the node/add/tomato page.
>>
>> I'd love to know if there's an approach to use for both drupal 5 and 6 -
>> if they aren't the same then I would super appreciate snippets for
>> both... I'm surprised to not have found this info anywhere in the
>> handbook...
>>
>> Thanks,
>>
>> q./
>>
>> --
>> tel: 1.416.642-5469
>> fax: 1.647.439-0891
>> -
>> Design Guru -  http://www.designguru.org
>> Using Open Source Software to foster community online.
>>
>> _______________________________________________
>> DUG-TO mailing list
>> DUG-TO at lists.openject.com
>> http://lists.openject.com/listinfo/dug-to
>
>
>
> --
> Khalid M. Baheyeldin
> 2bits.com, Inc.
> http://2bits.com
> Drupal optimization, development, customization and consulting.
> Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
> Simplicity is the ultimate sophistication. --   Leonardo da Vinci
>
> _______________________________________________
> DUG-TO mailing list
> DUG-TO at lists.openject.com
> http://lists.openject.com/listinfo/dug-to
>
>



-- 
Alan Dixon, Web Developer
http://consulting.civicrm.ca/


More information about the DUG-TO mailing list