Jump to content

Recommended Posts

Posted

I'm using $session->message and $session->error for my front end.

When using FieldtypeMapMarker module, a message displays after succesfully geocoding an address.
(Which I want to suppress from the front end)

Is this possible?
Better still could the message and error functions allow an aditional boolean to signify a different intended use?:

eg:
 

$session->message('Well done!', Notice::frontEnd);

// or user defined
$session->error('Sorry, Broken!', 'MyMessages'); 
Posted

You cannot add the constant to the Notice class without editing the core file, but the message method should be able to receive custom flags even if they are not a constants of the class.

Posted

Thanks Lost, after digging through the code it's quite obvious.
 

Adding this worked:

$session->message('Saved', true); 

Then just check when generating the notice messages:

foreach($notices as $notice) {

    if($notice->flags > 1) continue; // only process front end notices
    
    // display notices...
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...