LemonStand Documentation

cms:onPageNotFound

By default, when the browser requests a page not found in LemonStand, the CMS page with the url name "/404" is displayed. Using the cms:onPageNotFound event, you can bypass the default behaviour by having the event handler return true.

Event handler example:

public function subscribeEvents()
{
	Backend::$events->addEvent('cms:onPageNotFound', $this, 'no_page_found');
}
 
public function no_page_found()
{
	//do something
	
	//...
	
	//to avoid displaying the CMS page with "/404" url name, return true
	return true;
}

Next: cms:onGetCustomerGroupId event
Previous: shop:onGetProductTypeFieldOptions event
Return to Handling LemonStand events