Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Using MenuItem fields in transformations in repeaters View modes: 
User avatar
Member
Member
Oli Jeffery - 5/15/2012 9:09:02 AM
   
Using MenuItem fields in transformations in repeaters
Is it possible to grab a custom field from a MenuItem (in this case MenuItemCategory) and use it in a custom function on a transformation of a repeater on that page? The repeater displays the document type custom.keycontact and the documents it’s referencing are not directly below the page (as several pages will be referencing them) so I can’t use NodeParentID.

Specifically, in the below bit of code, “Renewables” should be replaced with whatever the MenuItemCategory is on the page containing the Repeater.

<%# BishopFlemingFunctions.MultipleProfiles(""+ Eval("contactMultiple") +"", "Renewables") %>

Can this be achieved?

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 5/15/2012 3:17:58 PM
   
RE:Using MenuItem fields in transformations in repeaters
You can try using a call to CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros("{%yourcustomfield%}") to pass the MenuItemCategory to your function.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 5/15/2012 3:21:19 PM
   
RE:Using MenuItem fields in transformations in repeaters
That is assuming that it uses the current document you are on and not the document currently being evaluated in the repeater. I haven't tested it, so I don't know for sure.


User avatar
Member
Member
Oli Jeffery - 5/16/2012 2:29:40 AM
   
RE:Using MenuItem fields in transformations in repeaters
That works perfectly, thanks!