Copied to clipboard

Flag this post as spam?

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


  • Adam Henriksen 4 posts 24 karma points
    Mar 19, 2015 @ 16:08
    Adam Henriksen
    0

    Exclude Macro Partial Views in Search Results

    In my search results, I'm getting an error in the bodyText returned for some of the results that have macro partials in them:

    Error loading Partial View script (file: ~/Views/MacroPartials/InsertUmbracoForm.cshtml)

    Does anyone know how to exclude this from the search results?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Mar 19, 2015 @ 16:18
    Dave Woestenborghs
    0

    Can you post some code on how you are displaying your search results ?

    Dave

  • Adam Henriksen 4 posts 24 karma points
    Mar 19, 2015 @ 16:22
    Adam Henriksen
    0

    Hi Dave,

    Here is the markup in my Razor template page. Very basic. I'm using the default ezSearch.cshtml partial view to display the results.

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = "Master.cshtml";
    }
    
    <div class="small-12 column">
        <h1>@Umbraco.Field("pageTitle")</h1>
        @Umbraco.Field("bodyText")
        @Umbraco.RenderMacro("ezSearch", new {rootContentNodeId="1051", rootMediaNodeId="1061", indexType="BOTH", searchFields="nodeName, bodyText", previewFields="nodeName, bodyText", previewLength="500", pageSize="10", hideFromSearchField="hideFromSearch", searchFormLocation="TOP"})
    </div>
    
  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Mar 19, 2015 @ 16:26
    Dave Woestenborghs
    0

    Do you know which line is the problem ? Is it where you display the body text or where you display search results ?

    Dave

  • Adam Henriksen 4 posts 24 karma points
    Mar 19, 2015 @ 16:28
    Adam Henriksen
    0

    It is where I display the search results. So, in some of the results it will list say 10 results found and in say the Contact Us result, it will have that error contained in the result body.

  • Adam Henriksen 4 posts 24 karma points
    Mar 19, 2015 @ 21:17
    Adam Henriksen
    0

    It turns out the issue is with the macro partial and not the ezSearch. The Umbraco Forms partial got corrupted somehow when I updated the package. Sorry for taking up your time.

Please Sign in or register to post replies

Write your reply to:

Draft