var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current); string id = e.Fields["id"].ToString(); var parent = umbracoHelper.TypedContent(id);
on my custom class. My aim is to load the parent Name into my indexer.
But it's not working. My examine indexer stopped working after this...
I am using the following extension:
using Examine; using System; using System.Text; using umbraco.BusinessLogic; using umbraco.providers.members; using Umbraco.Core; using Umbraco.Web;
I also tried var currentItem = Umbraco.TypedContent(e.NodeId);
Using Umbraco.ContentType(id) in C# Custom Class
Hi guys,
I am trying to do this
var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current);
string id = e.Fields["id"].ToString();
var parent = umbracoHelper.TypedContent(id);
on my custom class. My aim is to load the parent Name into my indexer.
But it's not working. My examine indexer stopped working after this...
I am using the following extension:
using Examine;
using System;
using System.Text;
using umbraco.BusinessLogic;
using umbraco.providers.members;
using Umbraco.Core;
using Umbraco.Web;
I also tried var currentItem = Umbraco.TypedContent(e.NodeId);
It doesnt work. Can someone help me?
Hi Thomas,
Can you post the error message that you're seeing? Also the TypedContent() method takes an int, not a string, so you could try that?
Thanks,
Maff
Hi
if i understand you correctly, you're trying to get the parent name of the node being indexed?
Try:
via the content service (database, so slower)
OR
*xml cache, with a hacky way to get the current context - works, but is it ok?*
OR
xml cache, as you've tried, but last time i tried, context was null as it's not available on the indexing thread (see: https://groups.google.com/forum/#!topic/umbraco-dev/-xto6IIPXrA)
is working on a reply...