public void Process(List<ITemplateAction> actions, MerchantTribe.Commerce.MerchantTribeApplication app, ITagProvider tagProvider, ParsedTag tag, string innerContents) { SearchFormViewModel model = new SearchFormViewModel(); string rootUrl = app.StoreUrl(false, true); model.SearchFormUrl = rootUrl + "search"; model.ButtonImageUrl = app.ThemeManager().ButtonUrl("Go", app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection); actions.Add(new Actions.PartialView("~/views/shared/_SearchForm.cshtml", model)); }
public void Process(StringBuilder output, MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, ITagProvider tagProvider, ParsedTag tag, string innerContents) { SearchFormViewModel model = new SearchFormViewModel(); string rootUrl = app.StoreUrl(false, true); model.SearchFormUrl = rootUrl + "search"; model.ButtonImageUrl = app.ThemeManager().ButtonUrl("Go", app.IsCurrentRequestSecure()); Render(output, model); }
private void Render(StringBuilder sb, SearchFormViewModel model) { sb.Append("<form class=\"searchform\" action=\"" + model.SearchFormUrl + "\" method=\"get\">"); sb.Append("<input type=\"text\" name=\"q\" class=\"searchinput\" /> <input class=\"searchgo\" type=\"image\" src=\"" + model.ButtonImageUrl + "\" alt=\"Search\" />"); sb.Append("</form>"); }