Join CONTENT_BlogPost with CONTENT_Blog and CMS_Tree

Brandon White asked on December 5, 2018 20:58

I'm trying to create a report of blog post data that contains the BlogPostBody from CONTENT_BlogPost and I also need CMS_Tree data like NodeName and NodeAliasPath but I can't figure out how to join anything to CONTENT_BlogPost. Has anyone else done this?

Correct Answer

Brenden Kehren answered on December 5, 2018 21:21

If you're using version 9.0 or greater, you can use something like this:

SELECT *
FROM View_CMS_Tree_Joined
INNER JOIN Content_BlogPost ON DocumentForeignKeyValue = BlogPostID
WHERE ClassName = 'cms.blogpost'

If you're using a version less than 9.0, then you can use the view specifically for the page type:

SELECT *
FROM View_Content_BlogPost_Joined
0 votesVote for this answer Unmark Correct answer

Recent Answers


Brandon White answered on December 5, 2018 22:12

Thanks Brenden, wasn't aware of the DocumentForeignKeyValue. That did the trick!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.