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 581 posts 1385 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 863 posts 3849 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 11280 posts 23678 karma points MVP 10x 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

Please Sign in or register to post replies

Write your reply to:

Draft