Just wondering if it would be possible to allow the 'Add another %type' message to be editable per content type? Even giving it theme possibilities would be helpful. I have currently patched the module file itself to check for a certain content type to display different text after each node of that type has been saved.

        $node_type = node_get_types('name', $node->type);
        if ($node_type == 'Carpool') {
        $_addanother_message = t('Add a <a href="@typeurl">%type</a> post for your return trip.', array(
          '@typeurl' => url('node/add/'. str_replace('_', '-', $node->type)),
          '%type' => node_get_types('name', $node) // would return value Carpool
          ));
        }
        else {
        $_addanother_message = t('Add another <a href="@typeurl">%type</a>.', array(
          '@typeurl' => url('node/add/'. str_replace('_', '-', $node->type)),
          '%type' => node_get_types('name', $node)
          ));
        }

In this situation if they wanted to have multiple postings they would choose a repeating date value associated with this content type. So I felt it nicer if the text was more descriptive about the next tasks available to the user.

Comments

robin monks’s picture

Status: Active » Closed (works as designed)

Although I would not be willing to further complicate the content type forms with additional fields (we already provide four checkboxes), you actually can override this message through your theme since addanother_message_message and addanother_button_message are theme functions.

For information on overriding theme functions, check out the Beginners guide to overriding themable output.

If you need to change the message for all node types to be the same, you can also use the String Overrides module.

As a bonus, using either of these methods removes the need to custom patch Add Another. I'd recommend moving your existing solution into your theme to make upgrading to future versions of Add Another easier.

cybermache’s picture

Status: Closed (works as designed) » Needs review

Hey Robin, thanks for the response. You're referencing how version 7.x functions, correct? Which is what I was looking for in version 6.x. I tagged this ticket with 6.x-1.x-dev because I did not see any theme_ functions within this module's files. I see theme_addanother_message_message in 7.x but not in 6.x. I've used String Overrides in the past but it didn't allow for my specificity and would not work in this instance.

Can the structure of version 7.x be back ported to 6.x? That would certainly solve my issue and make this module theme-able for Drupal 6.x users. Would it be possible to do this without further complicating the content type forms.

Thanks

robin monks’s picture

The module actually need substantial work to bring 6.x-1.x up to par with the work being done in 7.x-2.x; for the most part the 6.x version of this module could be considered minimally maintained. When the next release of 6.x does come around, I will work to get the messages within theme functions as they are in 7.x.

/Robin

robin monks’s picture

Status: Needs review » Closed (duplicate)