Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ModelAdmin Back button and Breadcrumbs not working


Go to End


1183 Views

Avatar
Urug

Community Member, 4 Posts

5 August 2013 at 1:21am

Edited: 05/08/2013 1:47am

class NewsAdmin extends ModelAdmin  {

  static $menu_title  = "News";

  static $url_segment = "news";
  
  static $url_rule = '$Action/$ID';

  static $managed_models = array('News');
} 

All is working except the Back button and Breadcrumbs navigation on admin page. I realized that cause of the problem is probably wrong url address of "add new/edit" page. The url of the "add new" page should be
admin/news/EditForm/field/News/item/new
I quess, but it's
admin/news/News/EditForm/field/News/item/new
As you can see, the name of the model is appended after NewsAdmin::$url_segment.
The back button (or the breadcrumb) then links to:
admin/news/News?
instead of
admin/news

any help?