you can do it a number of ways - but they all come down to getting the ID of the node and then using that in place of CurrentPage.
so if you have the ID of the node you can do .
var newsNode = Umbraco.Content(id)
newsNode will then work in place of CurrentPage in your code.
Id you put a content picker on your homepage - the editor could pick the node, then you get it like you would any other property
CurrentPage.NewsNode <-- i think this returns the ID - you have to then put into Umbraco.Content.
You can pass the node ID into the Macro via a macro paramater. (you have to create a parmeter on your macro then you can get the parameter via @Model.MacroParameters["nodeid"] )
or you could just for your news node from the root,
CurrentPage.Descendants("newsitem")
Will get you all newsitem types below the current node (which is your whole site if it's at the root) - not the fastest thing in the world because you are searching a lot of content.
load list of childern of page in other page
Can i load list of childern (News item )for page (News) in another page say (Home Page) ???? is it possible ?
that is code of my list
HI yes
you can do it a number of ways - but they all come down to getting the ID of the node and then using that in place of CurrentPage.
so if you have the ID of the node you can do .
newsNode will then work in place of CurrentPage in your code.
Id you put a content picker on your homepage - the editor could pick the node, then you get it like you would any other property
CurrentPage.NewsNode
<-- i think this returns the ID - you have to then put into Umbraco.Content.You can pass the node ID into the Macro via a macro paramater. (you have to create a parmeter on your macro then you can get the parameter via
@Model.MacroParameters["nodeid"]
)or you could just for your news node from the root,
Will get you all newsitem types below the current node (which is your whole site if it's at the root) - not the fastest thing in the world because you are searching a lot of content.
thanks Kevin Jump
i try that in my macro .plz can you help me with more details
Model.MacroParameters["nodeid"]
) it is workingis working on a reply...