Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Return Value of Field from Document Type with Macro View modes: 
User avatar
Member
Member
steve-bit-wizards - 3/20/2013 5:13:55 PM
   
Return Value of Field from Document Type with Macro
I'm attempting to display the phone number from a specific document. I found the Documents macro, and this seems like a perfect solution, however it won't return any data from fields of the document type.

Below is the macro in question. I'm placing this in the content area of the Editable text web part.
{%Documents["/Locations/Florida"].OfficePhone%}


Am I using this incorrectly? It seems like this should work, all of the fields are available when using the macro object tree browser.

Thanks!

User avatar
Certified Developer 13
Certified Developer 13
kentico-jx2tech - 3/20/2013 7:31:26 PM
   
RE:Return Value of Field from Document Type with Macro
try...
{%Documents.WithAllData["/Locations/Florida"].OfficePhone%}

User avatar
Member
Member
steve-bit-wizards - 3/21/2013 7:51:56 AM
   
RE:Return Value of Field from Document Type with Macro
Perfect, thank you for your help! I just found this article which explains with the .WithAllData is necessary.

http://devnet.kentico.com/docs/7_0rc/devguide/index.html?transformations_macro_expressions.htm

Using the WithAllData property ensures that the retrieved document objects include their coupled data, i.e. the specific fields defined for the given document type.