Is the Custom Layout Widget documentation correct?

Posted by Community Admin on 05-Aug-2018 16:16

Is the Custom Layout Widget documentation correct?

All Replies

Posted by Community Admin on 04-Nov-2011 00:00

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?

Posted by Community Admin on 09-Nov-2011 00:00

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

This thread is closed