Copied to clipboard

Flag this post as spam?

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


  • Sebastian Dammark 547 posts 1287 karma points
    Mar 21, 2011 @ 15:43
    Sebastian Dammark
    0

    Pages using this Document Type or Template ?

    Is it possible to get a list of pages who are using a specific document type or template ?

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    Mar 21, 2011 @ 15:47
    Hendy Racher
    2

    Hi Sebastian,

    How about a bit of SQL:

    /* content nodes using doctypeId */

    DECLARE @docTypeId AS int
    SET @docTypeId = 123 // Doctype Id to check

    SELECT *
    FROM cmsContent A
    INNER JOIN umbracoNode B ON A.nodeId = B.id
    WHERE contentType = @docTypeId

     

    /* content nodes using a templateId */

    DECLARE @templateId AS int
    SET @templateId = 123 // Template Id to check

    SELECT C.path AS 'Path',
    C.level AS 'Level',
    C.id AS 'Node Id',
    C.text AS 'Text',
    A.alias AS 'docType Alias'
    FROM cmsContentType A
    LEFT OUTER JOIN cmsContent B ON A.nodeId = B.contentType
    INNER JOIN umbracoNode C ON B.nodeId = C.id
    WHERE A.nodeId IN (
    SELECT contentTypeNodeId
    FROM cmsDocumentType A
    INNER JOIN cmsContentType B ON A.contentTypeNodeId = B.nodeId
    WHERE templateNodeid = @templateId
    )
    ORDER BY text ASC

    HTH,

    Hendy

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Mar 21, 2011 @ 15:47
    Jan Skovgaard
    0

    Hi Sebastian

    I think the "Sitemap" snippet could perhaps be used for this?

    Then you should be able to just alter the XSLT to write out the content from @nodeTypeAlias and @template I suppose? :)

    /Jan

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies