Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Listing document type based on parent node View modes: 
User avatar
Member
Member
pfitzer - 8/3/2010 10:23:05 AM
   
Listing document type based on parent node
Hi,
hope somebody can help.

I have 2 document types - degrees and courses. There can be many degrees and each degree can have many courses. My folder structure is as follows

school_A
+--Courses
+----Course_1
+----Course_2
+--degrees
+----Degree_1

school_B
+--Courses
+----Course_3
+----Course_4
+--degrees
+----Degree_2

In a nutshell, when I edit Degree_1, I only want to see the courses that are available for that school ie. Course_1 & Course_2.
I've been using:

SELECT NodeID AS value, NodeName AS text
FROM View_CMS_Tree_Joined
WHERE ClassName = 'Courses'

but that obviously returns all courses, whether its in that school or not.

Can anybody offer any suggestions. Thanks


User avatar
Member
Member
pfitzer - 8/3/2010 3:06:16 PM
   
RE:Listing document type based on parent node
got the answer..hope this helps others...

select NodeID, NodeName from View_CMS_Tree_Joined
where classname = 'courses' and NodeParentID in (
select NodeID from View_CMS_Tree_Joined
where classname = 'CMS.Folder' and NodeParentID in (
select NodeParentID from View_CMS_Tree_Joined
where classname = 'CMS.Folder' and NodeID in (
select NodeParentID from View_CMS_Tree_Joined
where classname = 'degrees' and NodeID = NUMBER
)
)
) order by NodeOrder, NodeName