The "status messages" page element does not work if you put it in a node edit / add page. In other cases it successfully replaces the already defined one from page.tpl.php and outputs the messages correctly.

Comments

TheMGamer’s picture

Priority: Normal » Major
Issue tags: +messages

anyone?

jeni_dc’s picture

I've seen the same thing happen by adding a node/add context in a node panel to display a form for a different content type. The solution for me was to add a preprocess function like so:

function YOURTHEME_preprocess_page(&$variables) {
  // This disables message-printing on ALL page displays
  $variables['show_messages'] = FALSE;
}

I got that from Stack Exchange when I was thinking about outputting the messages in the node.tpl.php instead of a panel pane since my messages were appearing on nodes with a node/add form on them.

I would think that interrupting the usual rendering of the messages is now giving panels a chance to render them.

TheMGamer’s picture

Thank you for your help. Also using some if statements, you can limit it to work only on some paths! For example:

if ($_GET['q'] == 'node/add/article') {
	$variables['show_messages'] = FALSE;
}

This way, it limits it only on 'node/add/article' path.

TD44’s picture

TheMGamer, jeni_dc,

hi i'm an ultimate beginner. I need more details.
Should i paste the code into node.tpl.php or page.tpl.php ?

<?php

function ASbartik_preprocess_page(&$variables) {
if ($_GET['q'] == 'node/add/article') {
	$variables['show_messages'] = FALSE;
}


}

(ASbartik is the name in ASbartik.info file )

Then would I be able to add the status messages pane anywhere into my panel variant (admin/structure/pages/edit/node_edit)?

Am i wrong?

delacosta456’s picture

hi all
i am also facing this situation can anyone help ?

The workaround provided are not working for me

Thanks