kaka135 wrote:Hi,
Can you guide me how to add the similar codes/functions in the home page as well? I am getting the error I mentioned earlier if I copied the same codes over to the home page, but I'd like to keep the AllShops page as well.
I need this function urgently, so I might not be able to wait until the integration feature is developed.
Thank you very much.
regards,
Lee Ka
Hi,
I came up with an idea how to achieve it:
You can call the All Shops action anywhere on the home page - open the Index.cshtml view and place this code, where you want to show the Store Locator functionality:
@Html.Action("AllShops", "StoreLocator", new { isStoreLocatorCalledFromHomePage = true })
Now, go to the AllShops.cshtml view and find this row:
Layout = "~/Views/Shared/_ColumnsOne.cshtml";
Place this code right after it:
if (Url.RequestContext.RouteData.Values["isStoreLocatorCalledFromHomePage"] != null && bool.Parse(Url.RequestContext.RouteData.Values["isStoreLocatorCalledFromHomePage"].ToString()))
{
Layout = "";
}
That is all !