Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Info about a specific document View modes: 
User avatar
Member
Member
ECAbacus - 10/23/2012 8:37:11 AM
   
Info about a specific document
Not sure if this is possible... was trying to determine if there's a way to get the context info for a specific page. I'm trying to drop a header above a CSS list menu, and was hoping to do something along the lines of...

<h3>{%# CMSContext.Document("/{0}").DocumentMenuCaption %}</h3>

Is this possible? Am I missing something obvious?

User avatar
Kentico Support
Kentico Support
kentico_janh - 10/23/2012 5:24:27 PM
   
RE:Info about a specific document
Hello,

If you are trying to render the DocumentMenuCaption property of a current page and if this page is the page menu item, you can use this:

<h3>{%CurrentDocument.DocumentMenuCaption%}</h3>


Best regards,
Jan Hermann

User avatar
Member
Member
ECAbacus - 10/24/2012 8:45:02 AM
   
RE:Info about a specific document
Yes, I know how to get this information about the CurrentDocument. I'm asking how to get similar information a document which isn't being loaded into the template.

User avatar
Kentico Support
Kentico Support
kentico_janh - 10/24/2012 2:13:45 PM
   
RE:Info about a specific document
Hello,

Sure, you need to specify the alias path for that document like:

{%Documents["/Home"].DocumentMenuCaption%}


Best regards,
Jan Hermann

User avatar
Member
Member
ECAbacus - 10/25/2012 3:49:16 PM
   
RE:Info about a specific document
Perfect, thanks!

User avatar
Member
Member
ECAbacus - 10/25/2012 3:55:02 PM
   
RE:Info about a specific document
Quick follow up. Say I was deep in the tree but wanted information about the first ancestor of the current node... {%Documents["/{0}"].DocumentMenuCaption%} doesn't seem to find it. Suggestions?

User avatar
Kentico Support
Kentico Support
kentico_janh - 10/25/2012 4:14:23 PM
   
RE:Info about a specific document
Hello,

I found a way how to do that and here it is:

{%
path = CurrentDocument.NodeAliasPath.Split("/");
return Documents["/"+path[1]].DocumentName;
%}


Best regards,
Jan Hermann