Estate Agent Site - Do not know how to get search working
Hi,
I am new to umbraco and I have been following Warren Buckley's excellent article on creating a responsive estate agent site. http://our.umbraco.org/projects/starter-kits/razor-estate-agents-starter-site. I have followed the article and installed with Webmatrix. I have got the site working but I do not understand how to get the search working. I am unsure how to use the alternative template SearchEstates. The code on the relevant part of my master template is below. I think after the select statement the form that is part of the sidebar should run the JSON snippet but I am unsure how to do this, can anyone help?
I have also added a screen shot of the slidebars that the article refers to.
<umbraco:Macro runat="server" language="cshtml"> @{ //Select the homepage node & then find the child locations node var homeNode = Model.AncestorOrSelf("Home"); var locationsNode = homeNode.DescendantsOrSelf("Locations").First();
//For each child pages of the locations node foreach (var page in locationsNode.Children) { <option value="@page.Id">@page.Name</option> } } </umbraco:Macro>
In my code I have not been able to get the JSON code to display the sliders, the code is still the part of the original static code. The locations are working.
I am a beginner and I do not know how to implement the Search code on my site. In the final section of the Warrens article he describes how to make the search results page work. In the search template I pasted the Razor-Search-Results-Snippet.txt. Next I made the changes to the drop down bar to display the list of estates by pasting the Razor-Master-Search-Dropdown-Snippet.txt into the master template inside the drop-down select tag. The drop down works and although pressing the search button results in an error indicatiing a problem with the data being passed to the search page I think this may be okay when I complete the posting with the rest of the code. Now I get a bit lost, I created a template called SearchEstates and pasted the Razor-JSON-Snippet inside as the article describes, however how dos this connect with the Master templete? It may have something to do with adding a url inside the master templates select tag (replacing the current code) but I am not sufficently knowledgeable to know how or what to do to implement this.
Estate Agent Site - Do not know how to get search working
Hi,
I am new to umbraco and I have been following Warren Buckley's excellent article on creating a responsive estate agent site. http://our.umbraco.org/projects/starter-kits/razor-estate-agents-starter-site. I have followed the article and installed with Webmatrix. I have got the site working but I do not understand how to get the search working. I am unsure how to use the alternative template SearchEstates. The code on the relevant part of my master template is below. I think after the select statement the form that is part of the sidebar should run the JSON snippet but I am unsure how to do this, can anyone help?
I have also added a screen shot of the slidebars that the article refers to.
<form id="search" action="/search" method="post">
<h3>Search</h3>
<label for="location">Location</label>
<select id="location" name="location">
<umbraco:Macro runat="server" language="cshtml">
@{
//Select the homepage node & then find the child locations node
var homeNode = Model.AncestorOrSelf("Home");
var locationsNode = homeNode.DescendantsOrSelf("Locations").First();
//For each child pages of the locations node
foreach (var page in locationsNode.Children)
{
<option value="@page.Id">@page.Name</option>
}
}
</umbraco:Macro>
</select>
<label for="price">Price</label>
<div id="priceSlider" class="slider"></div>
<input type="text" placeholder="£100,000" id="price" name="price" />
<label for="noRooms">Minimum Bedrooms</label>
<div id="roomSlider" class="slider"></div>
<input type="number" min="1" max="10" id="noRooms" name="noRooms" />
<label for="noBathrooms">Minimum Bathrooms</label>
<div id="bathroomSlider" class="slider"></div>
<input type="number" min="1" max="10" id="noBathrooms" name="noBathrooms" />
<input type="submit" value="Search" />
</form>
Hi, can you tell me or provide a screenshot of what happens when you click search? Thanks. Charlie
Hi Charlie,
In my code I have not been able to get the JSON code to display the sliders, the code is still the part of the original static code. The locations are working.
When I press search I get a macro error.
Ok so what do you need to achieve? :). Sorry are you saying the code is not included in the source or you dont know how to impliment it? Charlie :)
Anwar,
On your search results page tag the following onto the query string ?umbDebugShowTrace=true this will give you error in red can you then paste that.
Regards
Ismail
Hi all,
I am a beginner and I do not know how to implement the Search code on my site. In the final section of the Warrens article he describes how to make the search results page work. In the search template I pasted the Razor-Search-Results-Snippet.txt. Next I made the changes to the drop down bar to display the list of estates by pasting the Razor-Master-Search-Dropdown-Snippet.txt into the master template inside the drop-down select tag. The drop down works and although pressing the search button results in an error indicatiing a problem with the data being passed to the search page I think this may be okay when I complete the posting with the rest of the code. Now I get a bit lost, I created a template called SearchEstates and pasted the Razor-JSON-Snippet inside as the article describes, however how dos this connect with the Master templete? It may have something to do with adding a url inside the master templates select tag (replacing the current code) but I am not sufficently knowledgeable to know how or what to do to implement this.
is working on a reply...