Try Now
More in this section

Forums / Designing & Styling / Is the Custom Layout Widget documentation correct?

Is the Custom Layout Widget documentation correct?

2 posts, 0 answered
  1. David
    David avatar
    99 posts
    06 Sep 2012
    04 Nov 2011
    Link to this post
    I follwed the instructions in the documentation


    Based on the example, I can create the custom layout file here:


    Then when registering the layout from the back end adminstration, I only need to specify the path is specified as:


    But when I tried to implement the example, I get the following message when attempting to add the Layout to a page:

    Cannot find template "~/CustomLayouts/HeaderLayout.ascx"

    Is there another step I need to follow?

    Do I need to create a virtual path?

    How is Sitefinity to know that "~/CustomLayouts/HeaderLayout.ascx" translates to ~/App_Data/Sitefinity/WebsiteTemplates/PublicWebsite/CustomLayouts/HeaderLayout.ascx?
  2. Jen Peleva
    Jen Peleva avatar
    568 posts
    10 Sep 2016
    09 Nov 2011
    Link to this post
    Hello David,

    I assume you didn't interpret the example correctly. The paths in the beginning and at the end of the article are different:
    File:~/App_Data/Sitefinity/WebsiteTemplates/YourTemplate/CustomLayouts/Custom1.ascx (beginning)
    ~/CustomLayouts/treecolumns.ascx. (ending)
    In general, you need to specify the whole relative path to your layout template in order to be able to use it. For example, if your layout template, let's call it Custom, is located in the root directory of your project, in a folder with the name CustomLayouts, the relative path to it would be ~/CustomLayouts/Custom.ascx. Take a look at the attached screenshot for further reference.

    Kind regards,
    Jen Peleva
    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
2 posts, 0 answered