+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / orphans content

orphans content

8 posts, 0 answered
  1. DrGiorgini
    DrGiorgini avatar
    5 posts
    Registered:
    13 Jul 2010
    01 Oct 2010
    Link to this post

    Hi to all, I'm intersted to know how to get all "orphans content" whitin a page.

    If I use a generic content in page HOME with template MyTemplate1 and I change the template in MyTemplate2, the generic content is not visibile. I've think: it's be removed of this page...
    no... because If I change another time the template (in MyTemplate1), the control is present!

    I've tested and via code listing all Controls of a Page, and the GenericContent it's present.. but not visible---

    It's possible to get a list of this orphans content and move from a template to another (in a sitefinity mode, not with hard-code...)?
    Or exist a way (like a property) for make a content usable in a page across templates?

    thank!

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Oct 2010
    Link to this post
    Hello Ser-Vis,

    If the another master page has a ContentPlaceHolder with the same Id

    sample

    <div id="TopNavigation">
        <asp:contentplaceholder id="TopMenu" runat="server"></asp:contentplaceholder>           
    </div>

    the control that is in the holder will be moved to the another template automatically when you switch between your templates.

    All the best,
    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
  3. danfinney
    danfinney avatar
    51 posts
    Registered:
    09 Jul 2008
    30 Dec 2010
    Link to this post
    Ivan,

    We are building a Sitefinity 4 project and we had our content team enter the content prior to the design team building the custom templates.  They used one of the default templates that came with Sitefinity.  Now the design team has finished the custom templates, but when we switch a page to the custom template the content disappears.  How do we figure out what ContentPlaceHolder Id the default templates use?

    Thanks and Happy New Year!
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Dec 2010
    Link to this post
    Hi Ser-Vis,

    If the IDs of the ContentPlaceHolders in both the templates are the same you should see the content even if you switch the template.

    We have about ten built in templates. Which one you have used?

    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
  5. danfinney
    danfinney avatar
    51 posts
    Registered:
    09 Jul 2008
    31 Dec 2010
    Link to this post
    Ivan,

    Right, but our problem is that we don't know what the ContentPlaceHolders ID is in the built-in templates.  How do we determine what the IDs are?  We would need to know that to match up to our custom templates. 

    - Dan Finney
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Jan 2011
    Link to this post
    Hi Ser-Vis,

    The "ContentPlaceHolders"  of the base templates are dynamically generated, but you can see the IDs inside [sf_object_data] table or inspect the HTML when you edit a page with the base template. The ID looks like

    "T130D3B33000_Col00". The first part T130D3B33 comes from [sf_page_templates] where you can get the template name.

    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
  7. Jeremy Wadsworth
    Jeremy Wadsworth avatar
    6 posts
    Registered:
    01 Mar 2006
    18 Jan 2011
    Link to this post
    Can you tell me if I might be breaking something else by doing the following.

    Change all 90 pages in the site to use my new master page based template. Then run the following script to fix the orphaned content.

    update dbo.sf_object_data
    set place_holder = 'ContentPlaceHolder'
    where place_holder = 'T90999588000_Col01'

    Thanks
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Jan 2011
    Link to this post
    Hi Jeremy ,

    The holder ID should be equal in sf_object_data and sf_page_templates. Both the tables are related, so you should sync them. I do not suggest using the database queries to update the data. It would be better if you can set this ID as ID of your ContentPlaceHolder.

    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
Register for webinar
8 posts, 0 answered