Swift

Posts

From vintage cruisers to electric trail beasts, we’ve created detailed guides to help you discover the perfect bike for your lifestyle, travels, and riding goals. Whether you're commuting through city streets, tackling scenic gravel paths, or planning a cycling getaway, our posts bring each bike to life with stories, tips, and routes that match their character.

Error executing template "Designs/Swift-v2/QueryPublisher/PostGridWidthDate.cshtml"
System.InvalidOperationException: Unable to render view model template because no view model has been set.
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.QueryPublisher.QueryResultViewModel> @using Dynamicweb.Core.Encoders @using Dynamicweb @using Dynamicweb.Frontend <form method="get" class="d-flex gap-3 mb-4 flex-wrap"> <div class="flex-fill" style="max-width: 26rem"> @RenderPartial("Designs/Swift-v2/QueryPublisher/Post/PostSearch.cshtml") </div> <div class="overflow-y-auto"> @RenderPartial("Designs/Swift-v2/QueryPublisher/Post/PostHorizontalFacets.cshtml") </div> </form> @if (Model.Results.Count() > 0) { <div class="d-grid gap-4" style="grid-template-columns: repeat(auto-fill, minmax(300px, 1fr))"> @foreach (var post in Model.Results) { if (post.TryGetValue("PageId", out object? pageId) && pageId is int) { var pageObject = Dynamicweb.Content.Services.Pages?.GetPage((int)pageId); var pageInfo = pageObject != null ? Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(pageObject) : null; string? parentCategory = pageObject?.Parent != null && pageObject.Parent.Level != 1 ? pageObject.Parent.GetDisplayName() : null; if (pageInfo != null) { <a href="/Default.aspx?ID=@pageInfo.ID" class="card text-decoration-none"> @if (pageInfo.TryGetImageFile(out ImageFileViewModel imageFile)) { <div class="position-relative"> <img src="@imageFile.ToGetImage(new GetImageSettings { Ratio = "16/9" })" class="card-img-top" alt="@pageInfo.Name"> @if (parentCategory != null) { <div class="badge text-bg-secondary position-absolute top-0 end-0 m-2">@parentCategory</div> } </div> } <div class="card-body"> <h5 class="card-title"> @pageInfo.Name </h5> <div class="opacity-75 fs-7 mb-3">@pageInfo.CreatedDate.ToShortDateString()</div> <p class="card-text"> @pageInfo.Description </p> </div> </a> } } } </div> } else { <div class="alert alert-dark w-100 text-center" role="alert"> @Translate("No results found") </div> }