Perhaps I haz noobness,

But is there a way to Change "Create [insert content type]" to "Submit [insert content type]"?

So that when I go to http://example.com/?q=node/add/example, the title is Submit Example and not Create Example

I looked around with Devel, but found nothing.

Comments

solipsist’s picture

All text in Drupal's user interface is run through the translation system and are stored as string templates. Using this module you find these string templates and modify them:
http://drupal.org/project/stringoverrides

In your case the string template is probably "Insert !type". Just replace it with "Submit !type".

--
Jakob Persson - blog
Leancept – Digital effect and innovation agency

ballerjones’s picture

Thanks,

But I'm afraid "Create !type" does not exist. Or, at least, not for me. I have tried "Create %type" and "Create !contenttype" but to no avail. Would this be in my theme module? Or maybe in Node module?

solipsist’s picture

Node module. Just search for "create" and see what comes up.

--
Jakob Persson - blog
Leancept – Digital effect and innovation agency

ballerjones’s picture

Yep, right before you replied I found it.

Create @name

is the original.

Thanks for the link. I've been looking for something like this for a while. This site is full of useful tools but is very bad at revealing them to those in need. So people in forums end up being your search tool.

thanks again

cdd23’s picture

I am trying to do the same thing (change the word "Create" to "Submit" with content types, and I found this code in node.pages.inc:

function node_add($type) {
  global $user;

  $types = node_get_types();
  $type = isset($type) ? str_replace('-', '_', $type) : NULL;
  // If a node type has been specified, validate its existence.
  if (isset($types[$type]) && node_access('create', $type)) {
    // Initialize settings:
    $node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');

    drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));
    $output = drupal_get_form($type .'_node_form', $node);
  }

  return $output;
}

So the drupal_set_title is adding the "Create" before the content type name. I can change this to "Submit" and it changes the "Create [content type]" to "Submit [content type]" as I want it to, BUT I'm doing this in the core files (node.pages.inc). That is a no-no, right? When I update core in the future I'd have to go back in and re-edit node.pages.inc, right?

So I know I want to override this function, but where do I make the override? I've read about overriding and as far as I can tell I should be able to put the following code in template.php in my themes folder (i.e. sites/all/themes/zen_subtheme):

function zen_subtheme_node_add($type) {
  global $user;

  $types = node_get_types();
  $type = isset($type) ? str_replace('-', '_', $type) : NULL;
  // If a node type has been specified, validate its existence.
  if (isset($types[$type]) && node_access('create', $type)) {
    // Initialize settings:
    $node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');

    drupal_set_title(t('Submit @name', array('@name' => $types[$type]->name)));
    $output = drupal_get_form($type .'_node_form', $node);
  }

  return $output;
}

but when I do this my add new content pages still have the "Create [content type]" title.

I'm sure I'm missing something simple but I can't determine what it is...

Can anyone help?

senpai’s picture

I've had good success with using a hook_menu_alter to change the title of a page, since core doesn't seem to reliably respect the t() function of it's <?php drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));?>

To change the title on a D6 node/add or node/edit page, I use this example:
<?php
function hook_menu_alter(&$items) {
 // Change the /node/add title from "Create Content" to "Upload".
 $items['node/add']['title'] = 'Upload';
}
?>

****
Joel "Senpai" Farris | certified to rock score