I am trying to make a partial view that:
Displays all the documents in project 1, in project 1.
Displays all the documents in project 2, in project 2.
...
Displays all the documents in project 100, in project 100.
The view i have made (see below) displays all the content from project 1 in all the projects.
How to fix?
I also want the href to link to the acual document. How to fix?
You can fetch the id of current node for example if you are on project1 find the node id of this node if you are on project2 then find the node id of project 2 then find all it's child.
var currentpageid = CurrentPage.Id;
DocumentType nodeId = new DocumentType(currentpageid );
foreach (Node childNode in nodeId.Children)
{
// your logic
}
Trouble with partial view
I have made a project site the content tree looks like this:
I am trying to make a partial view that: Displays all the documents in project 1, in project 1. Displays all the documents in project 2, in project 2. ... Displays all the documents in project 100, in project 100.
The view i have made (see below) displays all the content from project 1 in all the projects. How to fix?
I also want the href to link to the acual document. How to fix?
You can fetch the id of current node for example if you are on project1 find the node id of this node if you are on project2 then find the node id of project 2 then find all it's child.
Thanks for the reply. I solved the issue getting children from the current page the following way:
`@foreach (var item in Model.Content.Children()) {
@item.Name
To the document ยป}`
is working on a reply...