search widget placement

Topics: General, Troubleshooting
Aug 31, 2011 at 7:28 AM

hi i have little trouble with placement.info i guess.

i have the search widget which gives me a text box and a button at the beginning of content.

when i hit search and shows results and puts the searchbox+button at the end of that. i already removed css to test if it's a floating error or something. but well, wasnt the case

so that's what displays the results

@if (searchResults != null && searchResults.Count() > 0) {
    @Display(Model.Pager)
    @Display(searchResults)
}

thats the form

@using(Html.BeginForm("index", "search", new { area = "Orchard.Search" }, FormMethod.Get, new { @class = "search-form" })) {

    <h2>Suche</h2>
    <fieldset>
        @Html.TextBox("q", (SearchViewModel)Model.ViewModel.Query)
        <button type="submit">@T("Absenden")</button>
    </fieldset>
}

and my placement.info

<Placement>
    <Place Parts_Search_SiteSettings="Content:1"/>
    <Place Parts_Search_SearchForm="Content:1"/>
    <Match ContentType="searchResults">
      <Place Parts_Content="Content:2"/>
    </Match>
</Placement>

i figured since in shapetracing it show sthe results as "content.cshtml" i had to place that part somewhere..

so i guess the thing not working is in here:

    <Match ContentType="searchResults">
      <Place Parts_Content="Content:2"/>
    </Match>

what am i doing wrong ?

Coordinator
Aug 31, 2011 at 8:00 PM

I don't know. What are you trying to do, and how is it not working?

Aug 31, 2011 at 8:11 PM

well my page starts and in content it has

|Search Field|

|button| here

 

when i search for something and it finds results it renders to

 

1 of x Results

Bla bla bla ( results here )

and then puts

|Search Field|

|button| here

at the end of the content.

 

but i want that field + button to stay on top, and place the results after that.

Coordinator
Aug 31, 2011 at 8:28 PM

Placement deals with local zones, but widgets are placed in top-level zones. You need a zone above content.