Is the Custom Layout Widget documentation correct? - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Is the Custom Layout Widget documentation correct?

  • Is the Custom Layout Widget documentation correct?
  • I follwed the instructions in the documentation

    http://www.sitefinity.com/documentation/designers-guide/custom-layout-widgets.aspx


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

    ~/App_Data/Sitefinity/WebsiteTemplates/PublicWebsite/CustomLayouts/HeaderLayout.ascx

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

    ~/CustomLayouts/HeaderLayout.ascx

    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"

    Questions
    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?
  • 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