Copied to clipboard

Flag this post as spam?

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


  • Trevor Loader 199 posts 256 karma points
    Mar 24, 2015 @ 21:10
    Trevor Loader
    0

    Add a new page (docType) to MerchelloBazaar

    Hi,

    I'm playing around with Merchello Bazaar and want to make other pages in the site like refund policy, terms and conditions etc.

    I can do this by adding a new doctype and template in the normal Umbraco manner but than I don't have access to the basket if I want to have basket totals in the header of these new pages.

    How do I get access to the basket or how do I change the template to inherit from one of the bazarr models which then does have access to the basket?

    Or can you not do this using normal doctypes/templates and have to use MVC instead?

    TIA Trevor

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Mar 24, 2015 @ 21:47
    Rusty Swayne
    0

    Hey Trevor,

    You can have your view (or partial) inherit from Merchello.Web.Mvc.MerchelloTemplatePage or Merchello.Web.Mvc.MerchelloViewPage

    These subclass the UmbracoTemplatePage and UmbracoViewPage

    You now have access to the CurrentCustomer in your view:

      var basket = CurrentCustomer.Basket();
    

    So you could build a nav or whatever doing something like that.

    Does that work for you?

  • Trevor Loader 199 posts 256 karma points
    Mar 24, 2015 @ 21:49
    Trevor Loader
    0

    Perfect...thats exactly what I was after!  Thanks.

  • J. B. 15 posts 88 karma points
    Apr 21, 2015 @ 18:13
    J. B.
    0

    A bit confused on how to inherit the Bazaar theme for standard Umbraco templates; recreating certainly won't enable dynamic site management for page editors.  Any suggestions?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Apr 22, 2015 @ 21:29
    Rusty Swayne
    0

    Hey J.B. I think a better solution would be to create a Bazaar theme that uses partials from the standard Umbraco partials folder. As for adding additional properties to the Bazaar views, they are all IPublishedContent so just add properties to the respective document type.

    If you then wanted to return a new model of some other type to your custom view you could handle Umbraco's PreRenderViewActionFilterAttribute.ActionExecuted event and build up the your custom model.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies