1
votes

In my Umbraco site I have a document type with a property of type Content Picker, that's all working fine.

What I want to do now is in the original page of the picked Content, I would like to reverse lookup the items that I have selected.

To give some context the page in question is a list of sightings of a particular boat. The site also has a directory of all the boats, therefore when you add a Sighting you can content pick the boat seen.

What I would like to do is on the list of boats include details of it being last sighted ie date and location.

Can anyone help me or point me in the direction of some information on how I can achieve this.

2
For clarification, could you distinguish the audience the information is being presented to. It sounds like the admin/backoffice work is working fine, but you are stuck on the presentation layer. The content picker is a backoffice control if I am correct and you don't display this to the end user. You would need to use something like a list box or drop down list to present them to the end user.Jerode
Yes the back office Document Types are wired up correctly. What I have is a list of Boats. I have another page called Sightings which allows a user to spot a boat and can select the boat seen from a drop down and add comments etc, this is all working fine. But what I would like is in the descriptions of all the boats I would like to add the details of when it was last seen, if possible.Frazer
Are you storing the values on when last seen in a separate database table or trying to set them in an Umbraco property?Jerode
In my Document Type I have a property of Content Picker Umbraco Property which should in theory create an association between the two which i would like to provide a reverse lookup for.Frazer

2 Answers

1
votes

UmbracoHelper sounds like what you may need to accomplish your goal. UmbracoHelper is the unified way to work with published content/media on your website.

0
votes

So this is what im doing

@foreach (var sighting in Umbraco.Content(1090).Children.Where("Lifeboat == " + item.Id))
{
    <div>
        @sighting.DateTime
        @sighting.location                      
    </div>
}
</code>

There is something I need to fix in that i need to get the Max Date Time for the sighting, this will bring back all of them which i dont really want and hence ditch the foreach.

It would also be nice to remove the 1090 id hard coding but i guess that's off topic.