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
I'm using Umbraco version 7.6.11.
In GatheringNodeData event I'm trying to collect the Urllink and add it to Index. To get the Url I need to get IPublishedContent object. To get that I've tried to us the UmbracoHelper.TypedContent.
![enter image description here]
Item is visible in the database
var person = umbracoHelper.TypedContent(nodeData.Fields["id"]);
if (UmbracoContext.Current == null)
var worker = new SimpleWorkerRequest("/", string.Empty, new StringWriter());
var httpContext = new HttpContext(worker);
var dummyContext = new HttpContextWrapper(httpContext);
context = UmbracoContext.EnsureContext(
new WebSecurity(dummyContext, ApplicationContext.Current),
context = UmbracoContext.Current;
var helper = new UmbracoHelper(context);
person = helper.TypedContent(nodeData.NodeId);
if (nodeData.Fields.ContainsKey("content") && nodeData.Fields.ContainsKey("id") && person != null)
Person is null.
This Document exists in database but doesn't exists in the umbraco.Config file, so I guess it is not in the Content cache.
I cannot use the ApplicationContext.Current.Services.ContentService.GetById(nodeData.NodeId), becuase I will not get the Url to the document.
What I'm doing wrong?
Can I get the Url in other way ?
Try this one:
Did you find a solution? Share with our community, please
In your first line, what type of object is nodeData? Do you have property converters turned on?
The nodeData variable is of type : IndexingNodeDataEventArgs.
No I dont have property converter turned on.
How can I benefit from the property converter?
So my solution to this was using ContentService and used ToUrlSegment method as it seems that I don't need full url, but only current page url segment.
So I guess I could get rid of the ContentService method and just base on the nodeData variable.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted