Forums / General Questions / how do I relocate messagestack output?

how do I relocate messagestack output?

Locked

Views: 1,107

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
1 Apr 2008, 6:04 PM
#1
bigjoed avatar

bigjoed

Zen Follower

Join Date:
Apr 2006
Location:
Fort Bragg, North Carolina
Posts:
152
Plugin Contributions:
0

how do I relocate messagestack output?

How could I move the div class="messageStackSuccess" somewhere else in the page instead of on top?

14 Apr 2008, 11:07 AM
#2
goosedesign avatar

goosedesign

New Zenner

Join Date:
Feb 2008
Location:
UK
Posts:
39
Plugin Contributions:
0

Re: how do I relocate messagestack output?

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.

14 Apr 2008, 12:02 PM
#3
goosedesign avatar

goosedesign

New Zenner

Join Date:
Feb 2008
Location:
UK
Posts:
39
Plugin Contributions:
0

Re: how do I relocate messagestack output?

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

$messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info->fields['products_name'], zen_output_string_protected($to_name)), 'success');

to

$messageStack->add_session('product_info', 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.

21 Apr 2008, 6:48 PM
#4
bigjoed avatar

bigjoed

Zen Follower

Join Date:
Apr 2006
Location:
Fort Bragg, North Carolina
Posts:
152
Plugin Contributions:
0

Re: how do I relocate messagestack output?

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 -->

25 Apr 2008, 6:53 AM
#5
goosedesign avatar

goosedesign

New Zenner

Join Date:
Feb 2008
Location:
UK
Posts:
39
Plugin Contributions:
0

Re: how do I relocate messagestack output?

That's great. Thought there must be an elegant solution somewhere. Thanks for posting it.