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