Blank Screen

Topics: Troubleshooting
May 13, 2014 at 5:41 AM
Hi everybody - I've been struggling with this for a while, thought I'd cast out to you folks for help.

Yesterday I'am installing orchard, and do some modification in my own themes. Error displaying correctly when I do mistake. But Now there's no error, just displaying blank white screen.

I'm new in ASP, IIS and Orchard, any help would be greatly appreciated. Thank you.
May 13, 2014 at 6:36 AM
fathur_rohman17 wrote:
Hi everybody - I've been struggling with this for a while, thought I'd cast out to you folks for help.

Yesterday I'am installing orchard, and do some modification in my own themes. Error displaying correctly when I do mistake. But Now there's no error, just displaying blank white screen.

I'm new in ASP, IIS and Orchard, any help would be greatly appreciated. Thank you.
Hello,

Please visit the Orchard TV Documentation page and start learning Orchard CMS.
May 13, 2014 at 7:34 AM
There is no exlpantion why the web page that I edited not displaying error and just displaying white page, other page is displaying correctly. Because error is very important messages for troubleshooting.
May 13, 2014 at 7:41 AM
What modifications did you make in your theme?
May 13, 2014 at 7:57 AM
I just make a new file for displaying search results. I know that Orchard have module search, and the results displayed in Modules\Orchard.Search\Views\Search\index.cshtml
@model Orchard.Search.ViewModels.SearchViewModel
@{
    Style.Require("Search");

    IEnumerable<object> searchResults = Model.ContentItems;
    Model.ContentItems.Classes.Add("content-items");
    Model.ContentItems.Classes.Add("search-results");
}
<h1>@Html.TitleForPage(T("Search").Text)</h1>

@if (HasText(Model.Query)) {
    if (!searchResults.Any()) { 
        <p class="search-summary">@T.Plural("There is <em>one</em> result", "<em>zero</em> results", searchResults.Count())</p>
    } else { 
        <p class="search-summary">@T.Plural("There is <em>one</em> result", "<em>{1} - {2}</em> of <em>{0}</em> results", Model.TotalItemCount, Model.StartPosition, Model.EndPosition)</p>
    }
}
@if (searchResults != null && searchResults.Any()) {
    @Display(searchResults)
    @Display(Model.Pager)
} 
I want to custumize the search display, like html tag and css. And then I create new file in Themes\MyThemes\Views\Zone-Content-url-search.cshtml.

Yesterday it displaying error "The model item passed into the dictionary is of type 'Orchard.UI.Zone', but this dictionary requires a model item of type 'Orchard.Search.ViewModels.SearchViewModel'.", but now just blank screen.
May 13, 2014 at 10:56 AM
Hello,

In order to override the search result or the index.cshtml coming from the Orchard.Search module. You need to create a folder called Orchard.Search inside your themes folder. Next create a folder called Search and then inside this folder create a Index.cshtml file. And then you may go ahead and paste the below code in this Index.cshtml file.
@model Orchard.Search.ViewModels.SearchViewModel
@{
    Style.Require("Search");

    IEnumerable<object> searchResults = Model.ContentItems;
    Model.ContentItems.Classes.Add("content-items");
    Model.ContentItems.Classes.Add("search-results");
}
<h1>@Html.TitleForPage(T("Search").Text)</h1>

@if (HasText(Model.Query)) {
    if (!searchResults.Any()) { 
        <p class="search-summary">@T.Plural("There is <em>one</em> result", "<em>zero</em> results", searchResults.Count())</p>
    } else { 
        <p class="search-summary">@T.Plural("There is <em>one</em> result", "<em>{1} - {2}</em> of <em>{0}</em> results", Model.TotalItemCount, Model.StartPosition, Model.EndPosition)</p>
    }
}
@if (searchResults != null && searchResults.Any()) {
    @Display(searchResults)
    @Display(Model.Pager)
} 
To style the List of search results you can use the CSS Class "search-results" and "search-form".

Styling the Search Result List, You can do this
.search-results li {
  padding: 30px;
  margin-bottom: 30px;
  color: inherit;
  background-color: #eee;
}
Same goes for the Search Form
.search-form {
  padding: 30px;
  margin-bottom: 30px;
  color: inherit;
  background-color: #eee;
}

Hope it helps

Best

Abhishek Luv
May 14, 2014 at 5:18 AM
abhishekluv wrote:
Hello,

In order to override the search result or the index.cshtml coming from the Orchard.Search module. You need to create a folder called Orchard.Search inside your themes folder. Next create a folder called Search and then inside this folder create a Index.cshtml file. And then you may go ahead and paste the below code in this Index.cshtml file.
@model Orchard.Search.ViewModels.SearchViewModel
@{
    Style.Require("Search");

    IEnumerable<object> searchResults = Model.ContentItems;
    Model.ContentItems.Classes.Add("content-items");
    Model.ContentItems.Classes.Add("search-results");
}
<h1>@Html.TitleForPage(T("Search").Text)</h1>

@if (HasText(Model.Query)) {
    if (!searchResults.Any()) { 
        <p class="search-summary">@T.Plural("There is <em>one</em> result", "<em>zero</em> results", searchResults.Count())</p>
    } else { 
        <p class="search-summary">@T.Plural("There is <em>one</em> result", "<em>{1} - {2}</em> of <em>{0}</em> results", Model.TotalItemCount, Model.StartPosition, Model.EndPosition)</p>
    }
}
@if (searchResults != null && searchResults.Any()) {
    @Display(searchResults)
    @Display(Model.Pager)
} 
To style the List of search results you can use the CSS Class "search-results" and "search-form".

Styling the Search Result List, You can do this
.search-results li {
  padding: 30px;
  margin-bottom: 30px;
  color: inherit;
  background-color: #eee;
}
Same goes for the Search Form
.search-form {
  padding: 30px;
  margin-bottom: 30px;
  color: inherit;
  background-color: #eee;
}

Hope it helps

Best

Abhishek Luv
I'm sorry, this method not work for me. When I edit the html tag, there's no changes happen. :'(