Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2011-01-17 21:21:46
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Output message to "messagepane"
I’m developing a simple plugin and wondered if there was a function available that outputs a message in the “messagepane” cell?
Offline
Re: Output message to "messagepane"
On what page? The message gets to the page via the pagetop()
function.
Code is topiary
Offline
#3 2011-01-17 21:55:13
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Re: Output message to "messagepane"
It’s the table cell top left of every page, labelled id=“messagepane”, that displays confirmation, error messages etc.
Offline
Re: Output message to "messagepane"
Right, on which page do you want the message to appear?
Code is topiary
Offline
Re: Output message to "messagepane"
As Jeff said, pagetop() is the answer. The pagetop()
outputs the full header, including navigation links and message pane.
The function takes two arguments; title and message: pagetop( title, message )
. In the function you are calling on your event you would do something like:
pagetop(
'My Page Title',
'My message'
);
If it’s already existing page, then it all depends from the page you are trying to place the message to.
Last edited by Gocom (2011-01-17 22:15:48)
Offline
#6 2011-01-17 22:14:49
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Re: Output message to "messagepane"
Oh I see. Thanks.
Does the pagetop function have to appear first in the order of statements within my function? The message I want to output is generated after a conditional is run within the same satement
Offline
Re: Output message to "messagepane"
leafy_loader wrote:
Does the pagetop function have to appear first in the order of statements within my function? The message I want to output is generated after a conditional is run within the same satement
Pagetop uses echo, so yes. It has to be placed before other echos. You can use variables to store the later echos or something similiar. I persoanally use arrays and implode it at the end of the function.
For example:
function xxx_my_pane($msg='') {
if('dog' == 'cat') {
$msg = 'Do did';
}
$out[] = 'something';
pagetop('Title',$msg);
echo implode('',$out);
}
Last edited by Gocom (2011-01-17 22:20:36)
Offline