Copied to clipboard

Flag this post as spam?

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


  • René 327 posts 852 karma points
    Jan 07, 2014 @ 18:47
    René
    0

    Full Text Search - Image

    Hi 

    Tanks for this pacakage.

    Umbraco v6.1.6  

    im using this to show the result and now i want to add a image from the product.

    when i return @results i cant see any id related to media.

    Any suggestion? 

    @foreach (var searchResult in resultsItem.Current.Select("/results/nodes/*"))
                {
                    var fullTextId = searchResult.Evaluate("string(./@id)");
                    var fullTextMedia = searchResult.Evaluate("string(./data [@alias='FullTextImage'])");
                    var fullTextTitle = searchResult.Evaluate("string(./data [@alias='FullTextTitle'])");
                    var fullTextSummary = searchResult.Evaluate("string(./data [@alias='FullTextSummary'])");
    
    
                    <div class="fulltextsearch_result">
                        <img alt="@Html.Raw(fullTextTitle)" src="/media/1025/default.jpg" width="80" height="80" />
    
                        <p class="fulltextsearch_title">
                            <a class="fulltextsearch_titlelink" href="@umbraco.library.NiceUrl(int.Parse(fullTextId))">@Html.Raw(fullTextTitle)</a>
                        </p>
    
    
    
    
                        <p class="fulltextsearch_summary">@Html.Raw(fullTextSummary)</p>
                    </div>
                }

  • René 327 posts 852 karma points
    Jan 07, 2014 @ 22:14
    René
    0

    Hi 

    I found the solution. 

    @{
        //Get the node
        dynamic node = Library.NodeById(@fullTextId);
    
        // Display the property 
        @node.image
        // Get the image                    
        var image1 = @node.image.mediaItem[0].Image.umbracoFile;
        <img alt="@node.header" src="@image1" width="80" height="80" />
    }
Please Sign in or register to post replies

Write your reply to:

Draft