How could I move the div class="messageStackSuccess" somewhere else in the page instead of on top?
How could I move the div class="messageStackSuccess" somewhere else in the page instead of on top?
I'd like to know the answer to this too. Loads of people have asked about it, but there don't seem to have been any replies. It looks like the message is written to the page using Javascript as it doesn't appear in the source code.
Ok think I'm getting somewhere. In my case, I wanted to move the 'email successfully sent' message that belongs to 'tell a friend'. The only way to do this was to edit the 'header_php.php' file in includes > modules > pages > tell_a_friend.
I changed line 122 from
toPHP Code:$messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info->fields['products_name'], zen_output_string_protected($to_name)), 'success');
This seems to tell the message to appear in the space designated for it in the product info template, rather than in the common header template. Smacks of a bit of a hack though and presumably you'd have to identify every occasion where the message is set to appear in the header and change it? I don't ever want it at the top of the page as I have absolutely positioned stuff up there and it will mess up my layout.PHP Code:$messageStack->add_session('product_info', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info->fields['products_name'], zen_output_string_protected($to_name)), 'success');
Here's how I relocated the messagestack output. I moved the following code:
<?php
// Display all header alerts via messageStack:
if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
}
if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
echo htmlspecialchars(urldecode($_GET['error_message']));
}
if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
echo htmlspecialchars($_GET['info_message']);
} else {
}
?>
from common\tpl_header.php to common\tpl_main_page.php immediately before <!-- bof breadcrumb -->
That's great. Thought there must be an elegant solution somewhere. Thanks for posting it.