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.

Releases and Announcements /

Latest news about the SilverStripe software.

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

Gridfield link to view individual record


Reply


4 Posts   350 Views

Avatar
bunheng

Community Member, 78 Posts

11 July 2014 at 3:05am

Edited: 11/07/2014 10:48pm

Hi There,

Is it possible to create a link to see the details of each individual record using gridfield.
Example like click on read more to see news details?

Thanks
Bunheng

Avatar
Willr

Forum Moderator, 5513 Posts

12 July 2014 at 11:30am

If you click anywhere on the row in GridField you will get taken to the edit / view screen for that record as long as you've added the GridFieldDetailForm component to your configuration.

$gridField->addComponent(new GridFieldDetailForm());

Avatar
bunheng

Community Member, 78 Posts

13 July 2014 at 3:13am

Hi Willr,

Thank very much for your reply. Actually gridfield work great in Admin area. I would like to display all DataObject items on homepage and link each item if the visitor would like to see the detail of each individual item, as an example the news module on this website http://www.tslrdp.org/where-we-work/kampong-thom/latest-news/ I did on SilverStripe 2.4.

Thanks in advance if you could give any example site how to do this.

Bunheng

Avatar
Willr

Forum Moderator, 5513 Posts

13 July 2014 at 8:47pm

Displaying the items on the front end is easy. See http://www.silverstripe.org/data-model-questions/show/6215 for a thread discussing this.