Layout-like control

Posted by Community Admin on 03-Aug-2018 02:24

Layout-like control

All Replies

Posted by Community Admin on 05-May-2010 00:00

With SF4 and the new layouts...is it possible to create a usercontrol that when I drop it onto the designer I get 3 placeholders to then drop 3 other controls into?

So then at render I can place those 3 content items however I want (tabstrip, jQuery, etc)?

What I mean is, can the usercontrols embed layout controls and have SF pick that up when I plop it onto the page...

(does that make sense?)

Posted by Community Admin on 05-May-2010 00:00

Hi Steve,

Thank you for using our services.

In Sitefinity 4.0 we have two types of page controls - content controls and layout controls. You can create your own layout controls and add them to the layouts toolbox. Then you can drop this control on the page while in the Layout editing mode of the Page Editor. Then  in Content editing mode you can add controls in your layout. This is what is available currently in the new version, I am not sure however if this is exactly what you are looking for. You can check those two help articles for more information on how to create layouts:
Layout Controls Overview
Creating Layout Controls

All the best,
Radoslav Georgiev
the Telerik team


Do you want to have your say when we set our development plans? Do you want to know when a feature you care about 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 05-May-2010 00:00

The question was more about can i "embed" a layout control into a usercontrol such that when I drop it onto the page it gives me more content placeholders automatically...so I dont want a layout control itself, but want to leverage the ability to have that dynamic content placeholder functionality of the layout controls

Posted by Community Admin on 05-May-2010 00:00

Hello Steve,

Unfortunately the controls are not designed to work this way. You will have to first go to Layout - drop the layout control anywhere on the page and then go to content to put content in its placeholders.

Best wishes,
Radoslav Georgiev
the Telerik team


Do you want to have your say when we set our development plans? Do you want to know when a feature you care about 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 08-Nov-2010 00:00

Hi, I've created a custom layout control, followed the steps indicated in the article and also using the existing controls as basis, but I'm having this error by the time I drag the created layout control to the page. It pops up:

Object reference not set to an instance of an object.

Posted by Community Admin on 08-Nov-2010 00:00

Please disregard my previous question. :)

Posted by Community Admin on 08-Nov-2010 00:00

However, I have a new error.

Unable to cast object of type 'ASP.Summary_8' to type 'Telerik.Sitefinity.Web.UI.LayoutControl'.

Posted by Community Admin on 08-Nov-2010 00:00

Hello jkregala,

What are the steps we can follow to replicate this error? It looks like that you use a custom Layout Controls. If so, what is the code you have?

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about 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 08-Nov-2010 00:00

Basically steps 1-5 of this article: www.sitefinity.com/.../pages-layouts-creating-layout-controls.html

And then I could already see the newly-added layout template among the existing ones. I added this newly added template into my page, saved it, exited the page, and when re-opened the page, boom.

Here's my code for the ascx file:

<%@ Control Language="C#" ClassName="Summary_8" %>
 
<div runat="server" id="content">
    <div runat="server" class="group col1">
 
    </div>
    <div runat="server" class="group col2">
 
    </div>
    <div runat="server" class="group col3">
 
    </div>
    <div runat="server" class="group col4">
 
    </div>
    <div runat="server" class="group col5">
 
    </div>
    <div runat="server" class="group col6">
 
    </div>
    <div runat="server" class="group col7">
 
    </div>
    <div runat="server" class="group col8">
 
    </div>
</div>

Error with the ClassName?

Posted by Community Admin on 08-Nov-2010 00:00

Hi jkregala,

Please take a look at this post - Issue with adding Layout Controls

Greetings,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about 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 10-Nov-2010 00:00

I don't see how that post is related to my error. Please help. Anyway on my .ascx file (which is the base file of my custom layout control) I tried to remove ClassName="Summary_8" but I'm having this error:

Unable to cast object of type 'ASP.sitefinity_customcontrols_layoutcontrols_summary_8_ascx' to type 'Telerik.Sitefinity.Web.UI.LayoutControl'.


Could I just have a sample .ascx file that I could base on so that I won't be having these problems anymore? I think you should update this article for BETA2 www.sitefinity.com/.../pages-layouts-creating-layout-controls.html if it's not working. I followed it word for word.

Posted by Community Admin on 10-Nov-2010 00:00

Hi jkregala,

The error you see is related to the other post  and I am not sure why do not use the sample code from there? You are getting a general cast exception - you cannot cast .ascx to type LayoutControl and my sample code in the other post clearly shows how to create a control that inherits from LayoutControl class. Furthermore there is a short video attached to the post that illustrates the behavior of the newly created LayoutControl. 

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about 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