Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul 184 posts 646 karma points
    Jul 25, 2017 @ 08:20
    Paul
    0

    Can't use UmbracoTemplatePage with CalendarOverviewModel ?

    David,

    I've hit another issue I could do with some assistance on.

    When trying to integrate the calendar into my site I noticed that the top of the view page uses:

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<CalendarOverviewModel>
    

    Yet in version 2, I was happily using:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    

    The latter allowed me to access all the properties of the page and also integrate in fields from my master template. This is no longer the case, and removing @inherits Umbraco.Web.Mvc.UmbracoTemplatePage prevents me from accessing things like @CurrentPage. Ok I thought, I'll try and not use @inherits Umbraco.Web.Mvc.UmbracoTemplatePage on my calendar pages, but removing it and commenting out any @CurrentPage references leaves me with an error of:

    Cannot bind source type Umbraco.Web.Models.RenderModel to model type EventCalendar.Umbraco.Model.CalendarOverviewModel.

    Is there a simple way I can integrate the calendar into a page with a template ?

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jul 25, 2017 @ 08:50
    David Brendel
    0

    Hi Paul,

    v3 uses RenderMvcController for generating the models used in the views. Thats why the view uses:

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<CalendarOverviewModel>
    

    The models used are inheriting the normal Umbraco RenderModel. So you should be able to use Model.Content to get access to umbraco stuff like helper methods, additional fields and so on.

    If you use the shipped document type then you have to add the @inherits statement above. And I would suggest using the shipped DT.

    The version I'm currently working on will ship with a Macro to render the calendar. With this integration is easier if you don't want to use the build in DT.

    Regards David

  • Paul 184 posts 646 karma points
    Jul 26, 2017 @ 14:06
    Paul
    0

    I decided to to completely remove all instances of everything Calendar based, having done so (working through each file the Calendar amends on the site and removing the old database tables) the site worked fine. Installing the latest version of the Calendar to 7.5 didn't prompt any errors initially but now I'm getting errors around 'cannot load locations' etc. I've not made any changes to anything that was installed in the package.

    Does this package actually work on 7.5 ? So far we've had a significant amount of difficulty getting it to actually work reliably. :-(

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jul 26, 2017 @ 18:13
    David Brendel
    0

    Hi Paul,

    sorry for the inconvenience, the package was tested against 7.5 and should work.

    Have you updated Newtonsoft.Json to version 7.0.1? This is necessary as the google calendar API relies on that version. That's the most common issue after an installation.

    Regards David

Please Sign in or register to post replies

Write your reply to:

Draft