To elaborate a bit more on what Mike stated. I'd highly recommend against using a 1 to 1 relationship (object selector) because we all know there will be that one instance where 1 doctor will work at multiple clinics.
Look at this a little different way and ask yourself a couple questions:
- Do the users need to navigate to
/office-1/doctor-1
?
- Can the doctor work at more than one office?
Typically for something like this, if the doctor can work at more than one office, we will place those doctors in a separate folder in the root of the content tree and call the folder /doctors
. If they will always be specific to that office, then place them directly under the office in a /doctors
folder.
If they are working at more than one office, you have 2 options:
- linked pages - creates a reference to that doctor in another location, creates URL sructure so you can actually navigate to that doctor, allows you to update that doctor's information in one place and have it replicated to all other instances.
- related pages - creates a simpile relationship between an office and a doctor.
If you need the doctor to have a physical page below the office, then use linked pages. If there is no need to have a page below the office, then use related pages. With related pages, you create a new relationship called "has this doctor". Then you go to an office and select Properties > Related pages and add a new relationship. Select the "has this doctor" relationship and in the right side, select the doctor which work at to that office. Do this for every doctor.
Use a repeater to display the doctors on the page. Select the path of /doctors
, under Relationship select "Display pages related to the current page" and check the box for "Main page is on the left side", finally select the "has this doctor" relationship name. Add your transformation information for the doctor page type and save it. This will display your doctors related to that location.
Using a linked page, I didn't provide the details on that as they are just like getting the info from the regular place in the content tree. Only thing different is you might want to use GetDocumentUrl(Eval<int>("DocumentID"))
as the method that retrieves the URL for the document.