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

Forums / Sitefinity SDK / External template for custom module not working

External template for custom module not working

3 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    18 Jan 2012
    Link to this post
    Hi all,

    I've created a custom module, based on the Products Module. When I try to set an external template for my Products Detail View, nothing happens. It still refers to the built-in template. I'm doing it exactly the same way as when linking external templates to e.g. the News Module or Blogs Module.

    Is this a known issue?

    Regards,
    Daniel
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    05 Dec 2016
    23 Jan 2012
    Link to this post
    Hello Daniel, 

     Mapping DetailsView.ascx will not work since it is not frontend template: Map FrontendProductsDetailsView.ascx template trougg Administration->Settings->Advacned->Controls->ContentView. After mapping a template remember to restart the application to apply changes.

    Kind regards,
    Stanislav Velikov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    23 Jan 2012
    Link to this post
    Hi Stanislav,

    After changing the LayoutTemplatePath in my custom module from this:
    /// <summary>
            /// Gets or sets the layout template path.
            /// </summary>
            /// <value>The layout template path.</value>
            public override string LayoutTemplatePath
            {
                get
                {
                    return ProductsModule.ProductsVirtualPath + layoutTemplateName;
                }
                set
                {
                    base.LayoutTemplatePath = value;
                }
            }

    to this:
    // <summary>
            /// Gets or sets the layout template path.
            /// </summary>
            /// <value>The layout template path.</value>
            public override string LayoutTemplatePath
            {
                get
                {
                    //return SchoolsModule.SchoolsVirtualPath + layoutTemplateName;
                    return base.LayoutTemplatePath;
                }
                set
                {
                    base.LayoutTemplatePath = value;
                }
            }

    I'm able to set a custom template path.
    I'm not using the embedded views, so this will work for me.

    Regards,
    Daniel
3 posts, 0 answered