Copied to clipboard

Flag this post as spam?

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


  • Tom 4 posts 24 karma points
    Dec 14, 2011 @ 16:59
    Tom
    0

    Umbraco Search with page content (blurb)

    Hello, 

    I had a quick look around the forum but I couldn't see anything on this, so sorry if its already been answered.

    I built a custom user controls following the rather helpful tutorial over at umbraco TV, then I added in some additional code so it fit with what we needed.

    The problem is that I’m trying to get hold of the Node content to display under the Node name on the search page and I can’t figure out how best to do this. For example if the search engine searched through the body text I want the first 20 words of this to show up under the hyperlink. 

    Is there a way of accessing my custom data types inside the user control ?

     

     

  • Tom 4 posts 24 karma points
    Dec 14, 2011 @ 18:09
    Tom
    0

    Problem solved I just pushed each Node Id from the loop into a Node object and out putted the doctype.

    public static string GetNodeDesc(this SearchResult sr)
    {
    Node node = new Node(sr.Id);
    return node.GetProperty("BodyText").Value;
    }
Please Sign in or register to post replies

Write your reply to:

Draft