Is there a way to publish a unique content ID when...
# help-with-umbraco
r
Each node (the
IPublishedContent
type that most page types will inherit from) has both a unique
Id
(generally 4+ digits but not always), e.g.
1234
, represented as an
int
. They also have a unique
Key
, e.g.
12345678-1234-1234-1234-123456789123
, represented as a
System.Guid
. Either of those could be used, probably the
Id
based on your example.
h
try
Copy code
'PageID': '@UmbracoContext.PublishedRequest.PublishedContent.Id'
This should give you the Id of the currentpage
r
They can access the
IPublishedContent
from the .cshtml file for the pages using the sample code huwred gave.
2 Views