Wrapping Generic Content Container

Posted by Community Admin on 03-Aug-2018 22:23

Wrapping Generic Content Container

All Replies

Posted by Community Admin on 25-Apr-2011 00:00

In SF 3.7 I wrote some code using this tutorial, http://www.sitefinity.com/help/developer-manual/how-to-gc-add-content-to-user-control.html

I tried porting this to 4.0, but am getting an error on the Content get block of code.

When I mouse over the interface IContentContainer it tells me that this is deprecated, but the code hint doesn't tell me what to replace it with.

When I search the 40 help, http://www.sitefinity.com/40/help/developers-guide/introduction.html, I don't see anything similar to the 3.x help article, or find any references to the IContentContainer and what to replace it with.

Is there a better way to be doing this in 4.0 ?

Thanks!

Posted by Community Admin on 26-Apr-2011 00:00

Hello David,

The first article (www.sitefinity.com/.../how-to-gc-add-content-to-user-control.html) is not valid for Sitefinity 3.7, because the GenericContent control cannot be wrapped in a user control.

In 4.0 you can use HtmlField

<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.Fields" TagPrefix="sf" %>
  
<sf:ResourceLinks id="resourcesLinks" runat="server">
    <sf:ResourceFile Name="Styles/Window.css" />
</sf:ResourceLinks>
  
<sf:FormManager ID="formManager" runat="server" />
<div style="width: 660px; overflow: hidden;">
    <sf:HtmlField
        ID="htmlEditor"
        runat="server"
        Width="99%"
        Height="370px"   
        EditorToolsConfigurationKey="ToolsFile"
        DisplayMode="Write"
        FixCursorIssue="True">
    </sf:HtmlField>
</div>
<script type="text/javascript">
    $("body").addClass("sfContentBlockDesigner");
</script>

or you can inherit from ContentBlockDesigner and ContentBlock control.

Best wishes,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 29-Apr-2011 00:00

Ivan, thank you for your response.

The original code example I used on SF 3.7.  In the admin section the user had the ability to click edit on page and the WYSIWYG editor would pop up, and they could enter content.   From the front end it would just display the HTML generated from the editor.

With the code example you provided both from the front end and the admin section I am getting the WYSIWYG editor, and from the page editor side of things it's just displaying the WYSIWYG inline and not as content then showing the WYSIWYG when clicking the edit link for that control.

Posted by Community Admin on 03-May-2011 00:00

Hi David,

The HTML filed should be added only to the control designer, since you should have Label/Literal in the template that is used by your control.

All the best,
Ivan Dimitrov
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

Posted by Community Admin on 03-May-2011 00:00

Ivan,

I did some search on how to do a control designer.  I searched and got these results (I hope the link works) http://www.sitefinity.com/search.aspx?insection=True&start=0&client=sitefinity_main_search&q=%2522control%2bdesigner%2522.

The first, the second and the fourth posts all appear to be in reference to creating a control designer in SiteFinity 4, but clicking the link results in a "oops there's a problem with our server" page.

The third post is to your blog, which appears to be from 2008, and doesn't seem to apply to SiteFinity 4 as I can't find the Telerik.Framework.Web.Designer.ControlDesigner class to inherit in the Telerik.Framework.dll.

Thanks,
David

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

Hi David,

The article is currently not available, because of the changes that we are making to it. I suggest that you should take a look at our SDK which contains widget samples that you can observe until we show the topic again. I am sorry for the inconvenience that this might have caused you.

Kind regards,
Ivan Dimitrov
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