silverstripe-restfulapi icon indicating copy to clipboard operation
silverstripe-restfulapi copied to clipboard

Getting page path as well as just URLSegment

Open jonshutt opened this issue 8 years ago • 1 comments

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.

jonshutt avatar Mar 31 '16 21:03 jonshutt

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.

colymba avatar Apr 01 '16 15:04 colymba