+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Custom widgets not displaying on pages with news/event templates

Custom widgets not displaying on pages with news/event templates

6 posts, 0 answered
  1. Chris
    Chris avatar
    11 posts
    Registered:
    05 Apr 2013
    02 May 2013
    Link to this post
    Hello all, hope somebody can be of some help :)

    I have created a couple of pages, one for event details and another for news items, with the Events and News single item widgets on. These pages also have our own bespoke navigation widget and breadcrumbs.

    Now, everything displays fine in the Sitefinity Editing view, but when I go to the live site and click through to the news page/events page, the news and events templates display fine, but our navigation and breadcrumbs do not. The navigation and breadcrumbs appear fine everywhere else on the site.

    Any ideas? Tearing my hair out a bit with it :/

    Thank you in advance,

    Chris
  2. Boyko Nistorov
    Boyko Nistorov avatar
    16 posts
    Registered:
    17 Oct 2016
    06 May 2013
    Link to this post
    Hello Chris,

    Thank you for using our services.

    To be able to provide assistance, could you please send us a sample of your custom navigation and breadcrumb controls, to be able to identify the problem?
     
    Kind regards,
    Boyko Nistorov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Chris
    Chris avatar
    11 posts
    Registered:
    05 Apr 2013
    07 May 2013 in reply to Boyko Nistorov
    Link to this post
    Hi Boyko,

    Many thanks for your reply.

    I've since established it isn't just the navigation and breadcrumb controls that disappear - it is any custom widget that I design. For example, given the following basic, completely minimal MVC widget:

    Controller (TestController.cs):

    [ControllerToolboxItem(Name = "TestWidget", Title = "Test Widget", SectionName = "Custom Widgets")]
        public class TestController : Controller
        {
            public ActionResult Index()
            {
                return View("Test");
            }
        }

    View (Test,cshtml):

    <h2>Test View</h2>

    .... the "Test View" heading appears fine in the Page designer, but then if I click through from a news article/event item on the live site it doesn't display.

    Now, I know this is probably something to do with the news detail page being an auto generated page (eg, news-article/2013/05/04/test-article). I've probably missed something really obvious! Do you have any ideas why my template (headings, footers etc) is being displayed but not my custom MVC widgets?

    Thanks again,

    Chris
  4. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    09 May 2013
    Link to this post
    Hello Chris,

    The problem is coming from the fact that by going to details view the URL does not match the index url. Please take a look at the following Blog post for a solution on this.

    Regards,
    Pavel Benov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Chris
    Chris avatar
    11 posts
    Registered:
    05 Apr 2013
    17 May 2013
    Link to this post
    Hi Pavel,

    Many thanks for your reply. Interesting blog post and good solution, thank you!

    Chris
  6. Mike
    Mike avatar
    10 posts
    Registered:
    19 Feb 2014
    10 Jul 2014 in reply to Chris
    Link to this post

    In the comments for that blog post, a different solution (and a better one, it seems) is presented, add the following code to your custom MVC widget so that unknown routes will execute the Index() route.

    protected override void HandleUnknownAction(string actionName)
    {
        Index().ExecuteResult(ControllerContext);
    }

6 posts, 0 answered