Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I have a few razor lines. I expect to two lines to return the same value. But is doesn't.
@(new umbraco.cms.businesslogic.web.Document(1151).Id) // result: 1151 @(new DynamicNode(1151).Id) // Result: 0
Can someone tell me why?
Damiaan,
Both values should be the same if document with id = 1151 is published. Document api works with both published and unpublished content, whereas DynamicNode is an implementation of INode which obviously only works with published content.
@(new umbraco.presentation.nodeFactory.Node(1151).Id)// result: 1151@(newDynamicNode(1151).Id)// Result: 1151
Above snippet should always return the same values for both statements
Cheers,
/Dirk
Hi Dirk,
The node was published and created by another team member.
Apparently the node didn't exist in the umbraco.config file. A republish site solved the issue.
So i guess that the dynamicNode looks into the umbraco.config while the busineslogic.web.document looks into the database.
Thanks a lot
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
DynamicNode is empty
Hi
I have a few razor lines. I expect to two lines to return the same value. But is doesn't.
Can someone tell me why?
Damiaan,
Both values should be the same if document with id = 1151 is published. Document api works with both published and unpublished content, whereas DynamicNode is an implementation of INode which obviously only works with published content.
Above snippet should always return the same values for both statements
Cheers,
/Dirk
Hi Dirk,
The node was published and created by another team member.
Apparently the node didn't exist in the umbraco.config file. A republish site solved the issue.
So i guess that the dynamicNode looks into the umbraco.config while the busineslogic.web.document looks into the database.
Thanks a lot
is working on a reply...