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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

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

Link from virtual page


Go to End


976 Views

Avatar
Stefdv

Community Member, 110 Posts

2 March 2011 at 8:46am

Hello,

i used the tutorial ; http://www.ssbits.com/tutorials/2010/dataobjects-as-pages-part-2-using-model-admin-and-url-segments-to-create-a-product-catalogue/

Everything is working great, i used it to manage dogs for a breeder. On my Something_show.ss ( a virtual page that displays my dataobject) there's a table displayed containing dogs that are the parents of the actual Dog. ( A pedigree) now i need to link from the objects on the virtual page.

Layout;

( DataObject Dog is the actual dog the breeder owns )
Dog has_one Pedigree
Pedigree has_many Dogs

(DataObject PedigreeDog are the parents, greatparents etc of the Dog, that builds the pedigree )
Pedigree many_many PedigreeDogs
PedigreeDog belongs_many_many Pedigrees

I have only one 'real' page ...'DogPage'. This page shows the Dogs, i can link from a Dog and it show in a virtual page 'DogPage_Show'. The virtual page then shows the details of the dog and the pedigree. Now i want a link on every Pedigree dog to show the details of that dog also.

Page -> Link DO1 to VirtualPage1 -> Shows details of DO1 and a table containing DO2 ->Link DO2 to VirtualPage2 -> Show details of DO2.

I hope this makes sence to anybody :(