This topic is locked

Display message using $message

5/19/2008 4:34:26 PM
PHPRunner General questions
L
Lisa2006 author

Hi Forum,
I've used the line below as part of my error routine on the ADD Page & EDIT Page events.
$message = "<font color=#FF0000>" . "<strong>" . "my error message here ..." . "</strong>" . "</font>";
My question is how do i display a simlar style message on the LIST Page?
I've tried to place the $message line into the List page | List On Load, but do not see any results.
Help & Support would be much appreciated.
Lisa

A
alang 5/19/2008

One way I use is on the visual editor, insert PHP code snippet and print it from that. I actually have a custom template (so it is available on every list page in my project) and use a session variable to hold the message text, if any.

L
Lisa2006 author 5/20/2008

Thanks for the reply.
Is it possible to provide a sample code snippet?
thanks in advance
Lisa

A
alang 5/20/2008

Basically just use:

echo $message;
I use a $_SESSION variable which is set anywhere in the event code and then unset when page first loaded. ie
in load event:

if(isset($_SESSION["ListMessage"]))

unset($_SESSION["ListMessage"]);
in event code prior to display:

if(<error condition>)

$_SESSION["ListMessage"] = "Error message"
in visual editor code snippet:

if(isset($_SESSION["ListMessage"]))

echo $_SESSION["ListMessage"];