Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sonja 133 posts 621 karma points
    Jul 10, 2019 @ 08:19
    Sonja
    0

    about data saved in database

    hi,

    I have to take all content types from the database. The problem is with nested content. Where do I find what kind of nested content in one content type? For example we have Document type id 1062 that has name MultiplePod and has nested content named Pods with ID 1060. The nested content contains Document type Single pod with id 1055. I found all in the database in the table UmbracoNode. The only thing that I can't find is where is the connection between nested content ID 1060 and its content types 1055 Please advise

  • Sonja 133 posts 621 karma points
    Jul 16, 2019 @ 11:12
    Sonja
    0

    noone?

  • Sibren 40 posts 212 karma points c-trib
    Jul 16, 2019 @ 13:31
    Sibren
    0

    Hi Sonja,

    I might not understand you correctly, but I'll give it a go: Are you mixing up Node ID's with Document Type ID's?

  • Sonja 133 posts 621 karma points
    Jul 17, 2019 @ 05:08
    Sonja
    0

    not exactly.

    I need to know where can I find the Document Type ID of the Document types used in a specific nested content

  • Sonja 133 posts 621 karma points
    Jul 17, 2019 @ 05:11
    Sonja
    0

    not exactly.

    I need to know where can I find the Document Type ID or the Node Id or any ID of the Document types used in a specific nested content

  • Sibren 40 posts 212 karma points c-trib
    Jul 24, 2019 @ 05:08
    Sibren
    0

    You can get the DocumentType by using: item.ContentType.Id

    var items = model.Content.Value<IEnumerable<IPublishedElement>>("myPropertyAlias");
            foreach (var item in items)
            {
                var id = item.ContentType.Id;
            }
    
  • Sonja 133 posts 621 karma points
    Jul 24, 2019 @ 05:31
    Sonja
    0

    hi Sibren,

    No this is not the solution I'm searching for. In the project I don't have Umbraco installed and I need to find them in the database. Since everything in Umbraco needs to be saved in the database, so this should be too. The question is where is the connection between the nested content and Id of the tab or document type saved?

    Thanks Sonja

  • Erik-Jan Westendorp 29 posts 295 karma points MVP 5x c-trib
    Jul 24, 2019 @ 09:56
    Erik-Jan Westendorp
    0

    Hi Sonja,

    I'm not entirely sure if this is what you are looking for but you can get the content from the database by following the next steps.

    Search through the cmsPropertyType table and search for properties related to your Document type, in your case 1062.

    SELECT *
    FROM cmsPropertyType
    WHERE contentTypeId = 1062
    

    You can find your nested content property by alias. Use the id of the property to search through umbracoPropertyData table like so:

    SELECT *
    FROM umbracoPropertyData
    WHERE propertytypeid = [yourId]
    

    Hopefully this will help you a bit. :)

  • Sonja 133 posts 621 karma points
    Jul 25, 2019 @ 06:08
    Sonja
    0

    Hi Erik-Jan,

    The first query gives me the nested content component, thats ok but I need to get what is inside that nested content, the nested content contains another document types i need the IDs of those document types. For the second query, this table doesn't exist, I'm using Umbraco 7, exactly 7.15.0

    Thanks,

    Sonja

  • Erik-Jan Westendorp 29 posts 295 karma points MVP 5x c-trib
    Jul 25, 2019 @ 07:16
    Erik-Jan Westendorp
    0

    Hi Sonja,

    Sorry.. I used a V8 database, for V7 you need the cmsPropertyData table.

    SELECT * 
    FROM cmsPropertyData
    WHERE propertytypeid = [yourId]
    
  • Sonja 133 posts 621 karma points
    Jul 25, 2019 @ 11:08
    Sonja
    0

    Hi Erik-Jan,

    cmsPropertyData is completely empty because I don't have content. And I don't need nothing from the content, just the structure.

    Thanks,

    Sonja

  • Erik-Jan Westendorp 29 posts 295 karma points MVP 5x c-trib
    Jul 25, 2019 @ 14:36
    Erik-Jan Westendorp
    100

    Hi Sonja,

    Ok, maybe the cmsDataTypePreValues table is what you are looking for. The nested content structure is saved here. In this table you can find contentTypes (saved as JSON), minItems, maxItems etc.

    Use the cmsPropertyType table again but get the dataTypeId.

    SELECT *
    FROM cmsPropertyType
    WHERE contentTypeId = 1062
    

    Next step is to get the configuration, you can use the cmsDataTypePreValues table to find it.

    SELECT *
    FROM cmsDataTypePreValues
    WHERE datatypeNodeId = [yourId] AND alias = 'contentTypes'
    

    The value will look like something like this:

    [
        {
            "ncAlias": "typeOne",
            "ncTabAlias": "TabName",
            "nameTemplate": ""
      },
      {
          "ncAlias": "typeTwo",
          "ncTabAlias": "TabName",
          "nameTemplate": ""
      }
    ]
    

    If you want to get the document type(s) you can use the ncAilas to query the cmsContentType like so:

    SELECT *
    FROM cmsContentType
    WHERE alias = 'typeOne'
    
  • Sonja 133 posts 621 karma points
    Jul 30, 2019 @ 06:33
    Sonja
    0

    Yes Thanks Eric-Jan. I went thru all the tables seems like this is the only way to connect the document type with the nested content. Sadly no connection by ID, even because of using JSON instead of normal database types it is difficult to query it.

  • Sonja 133 posts 621 karma points
    Jul 30, 2019 @ 06:57
    Sonja
    1

    Actual query:

    SELECT        cmsDataTypePreValues.value
    FROM            cmsPropertyType INNER JOIN
                             cmsDataTypePreValues ON cmsPropertyType.dataTypeId = cmsDataTypePreValues.datatypeNodeId
    WHERE        (cmsDataTypePreValues.alias = N'contentTypes') AND (cmsPropertyType.contentTypeId = 1062)
    
Please Sign in or register to post replies

Write your reply to:

Draft