tim-createwell.com
-
9/11/2013 12:15:40 AM
Related Documents
Hi there,
I am trying to programmatically access documents that I have assigned to a page through a specific relationship: "HasPageSetting".
At the moment the following code:
if (CMSContext.CurrentDocument.RelatedDocuments["HasPageSetting"].Count > 0)
Returns "1" as there is a document related to the currently selected page, however I can't seem to find a way in which I can access the attributes/values of this related document!
I have tried:
CMSContext.CurrentDocument.RelatedDocuments["HasPageSetting"].FirstItem.GetValue("BackgroundImage");
But this fails - it complains that my related document object doesn't exist!
Unfortunately the documentation regarding related documents is very sparse, does anyone have any ideas how this is all supposed to work?
Any help would be greatly appreciated.
Regards, Tim.
|