Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jon Dunfee 199 posts 468 karma points
    Aug 23, 2013 @ 00:22
    Jon Dunfee
    0

    Index Rendered Content in v6.1.3

    I have a doc type when rendered grabs details from its children and referenced content through pickers.  I'm in the process of putting together my custom indexer and figured it would be simplest for me to render the page, strip the html and inject the results into a field during GatheringNodeData event on the indexer.  Well, this isn't as simple as I'd hope.  I get a NullReferenceException executing this line of code:

            private void GuideIndexerOnGatheringNodeData(object sender, IndexingNodeDataEventArgs e)
            {
                if (e.IndexType != IndexTypes.Content) return;  // how did you get in here? Content only please
    
                var node = new Node(e.NodeId);
    
                // Magic suppose to happen here, instead I get a slice of Null pie in the face
                var page = umbraco.library.RenderTemplate(node.Id, node.template);
    
                // Do stuff will eventually go here
    
            }
    

    The node is legit.  The template is legit.  What I'm doing must not be.  Any pointers out there?

Please Sign in or register to post replies

Write your reply to:

Draft