Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Creating pages automaticaly from a DataObjectSet with one page per dataObject

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 1898 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Creating pages automaticaly from a DataObjectSet with one page per dataObject Link to this post

    Whoa, whoa.. no need to edit the core files.

    In your _config.php, you can create arbitrary URL rules.

    Director::addRules(50, array(
    'some-url/$Action/$ID/$OtherID/$Foo/$Bar' => 'MyController'
    ));

    Then the url /some-url/action/123/456/more/stuff

    will feed those params to the MyController class.

  • vancouverWill
    Avatar
    Community Member
    121 Posts

    Re: Creating pages automaticaly from a DataObjectSet with one page per dataObject Link to this post

    okay I understand it now I copied the line

    Director::addRules(1, array(
       '$URLSegment/$Action/$ID/$OtherID' => 'ModelAsController',
    )

    directly into my _config.php file and that did nothing. After seeing your code I tried it again with the 50 in there and got nothing. Then I realized perhaps it does not work universal and I tried it with the specific URL and the specific controller, then it was golden.

    Thanks so much for the help. The forums are amazing with silverstripe.

    1898 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.