colymba / silverstripe-restfulapi

SilverStripe RESTful API with a default JSON serializer.
BSD 3-Clause "New" or "Revised" License
64 stars 34 forks source link

Getting page path as well as just URLSegment #69

Open jonshutt opened 8 years ago

jonshutt commented 8 years ago

Would be good if there was a nice way of passing a page full URL to the json. Currently a page returns the URLSegment, but no full path.

colymba commented 8 years ago

You can do that via a DataExtension on your DataObject/Page and take advantage of the onBeforeSerialize to add an extra field with the Link() value of the page.

I'll try to put an example together when I have a minute.