
Brett Davis (Customer) asked a question.
Any ideas on why a template/widget wouldn't update on the development site? It works on my local machine
I have a widget and a page layout that are not working as they should on the development server. The development server is hosted on Azure. On my local machine, it is working properly. I'm at a lost on what the issue is.
The code is retrieving data from the Model.Items and outputting them on the page.
Does anyone have any suggestions on what to check/test? Is there any way I could test/debug this better?
Hey Brett,
Could you provide us some more details on what "it's not working" means? Are styles missing, is there a error in the UI, can you not add it to the page? Also what version are you on?
I'm using version 11.
The widget is really similar to this code example:
https://github.com/Sitefinity/feather-widgets/blob/master/Telerik.Sitefinity.Frontend.DynamicContent/WidgetTemplates/ContainerTemplates/ListTemplateContainer.cshtml
The best way to describe not working is, I'm not getting any output of anykind. The widget is not returning any data and it is not displaying an error message. If I comment out all the code and type in "Hello World", that is also no returning anything.
Can you ensure that the View was deployed to the server and that the new compiled version of the web app gets deployed as well. Also on the server check ~/WebsiteRoot/App_Data/Sitefinity/Logs/ for an error or trace log for any errors that might have been logged. Post any related errors here. The best way for us to help is if you can paste the model/view/controller here (if possible).
I did check and the view was deployed to the server. The widget code is there as well. Do you have any other suggestions?
Unfortunately, there aren't any issues in the log file.
The code that is being run is the widget cshtml file:
@model Telerik.Sitefinity.Frontend.DynamicContent.Mvc.Models.DynamicContentListViewModel
@using Telerik.Sitefinity.Frontend.DynamicContent.WidgetTemplates.Fields.Helpers;
@using Telerik.Sitefinity;
@using Telerik.Sitefinity.Data.ContentLinks;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Frontend.Mvc.Models;
@using Telerik.Sitefinity.Web.DataResolving;
@using Telerik.Sitefinity.Model.ContentLinks;
@using Telerik.Sitefinity.Modules.Pages;
@Html.Script(ScriptRef.JQuery, "top", false)
<div class="@Model.CssClass">
<ul>
@foreach (var item in Model.Items)
{
var navigateUrl = HyperLinkHelpers.GetDetailPageUrl(item, ViewBag.DetailsPageId, ViewBag.OpenInSamePage, Model.UrlKeyPrefix);
<li @Html.InlineEditingAttributes(Model.ProviderName, Model.ContentType.FullName, (Guid)item.Fields.Id)>
<h3>
<a @Html.InlineEditingFieldAttributes("Title", "ShortText") href="@navigateUrl">
@item.Fields.Title
</a>
</h3>
<div>
@item.GetDateTime("PublicationDate", "MMM d, yyyy, HH:mm tt")
@Html.CommentsCount((string)navigateUrl, item.DataItem)
</div>
</li>
}
</ul>
@if (Model.ShowPager)
{
@Html.Action("Index", "ContentPager", new { currentPage = Model.CurrentPage,
totalPagesCount = Model.TotalPagesCount.Value,
redirectUrlTemplate = ViewBag.RedirectPageUrlTemplate })
}
</div>
Do you have any suggestions on how I could test/debug this on external site?
@Brett Davis (Customer) How did you deploy this change to your web server? Did you just copy the view file to the server, or did you use a deployment process?
Also, did you try restarting the web server? I have seen this also work.
Craig
I've tried restarting the server. I copied the view file into the widget editor in the sitefinity adminstrator.
I did some more research and it seems like the issue is only the first widget is firing in the placeholder. It seems like the the second widget never fires/runs. Any suggestions on what it could be?
@Brett Davis (Customer)
I recently had a case where the @Model.Items object was not returning any data. To resolve that issue I just had to do the following...
Hopefully that helps resolve your issue.
Thanks,
Craig
Craig,
Thanks for your help!
Unfortunately, on my local environment(The one that is working) and the stage environment, both fields are blank.
At this point, I'm guessing entering a test value into stage won't break anything. What would be an appropriate value that I could enter?
Thanks,
Brett