This project is read-only.

Link to container

Topics: Customizing Orchard, General
Dec 26, 2013 at 11:21 AM
i've defined a new content type with container part and a new content type with containable part.
when i show the list of contained item of a container i would like to show a link to the container.
How can i do it?
Thank you
Jan 5, 2014 at 4:50 AM
From where? A projection? A template? Can you give some more details?
Jan 7, 2014 at 7:54 AM
i've created a projection to show the container items and for each container i show the contained items with the built-in funtion of container part.
In the detail page of the contained item i would like to insert a link to return to the container item that contains the current contained item.
To the achieve my target i've inserted in the template file:

<a href="@Url.ItemDisplayUrl((ContentItem)Model.ContentItem.CommonPart.Container)">Return to container</a>

Is this the correct way?


Jan 7, 2014 at 8:14 AM
Looks fine to me.
Jan 7, 2014 at 9:05 AM
It was quite difficult for me to find the solution because i've not found complete documentation.
Do you know if there's a place where to find the complete reference of the available functions in template file?
Jan 8, 2014 at 8:14 AM
There cannot be a complete reference, as the system is too extensible for that, but Sébastien had built a cheat sheet that was quite useful and close to what you're asking for. I don't quite remember where it was hosted however.
Jan 8, 2014 at 8:27 AM
i've found it