API
Version 7.x > API > Documents[] Macro View modes: 
User avatar
Certified Developer v6
Certified Developer v6
szarouski - 10/11/2012 4:00:35 PM
   
Documents[] Macro
Can someone please explain me what the number which you can pass in the Documents[] macro mean? I thought it is a DocumentID, but it doesn't work like that (doesn't return Document based on ID if I pass correct DocumentID).
I can pass a path in Documents to get some node, for example this will return root document:
{% Documents["/"] %}

Just in case - I see that in Kentico 7. Path string works just fine.

User avatar
Kentico Support
Kentico Support
kentico_radekm - 10/22/2012 4:52:47 AM
   
RE:Documents[] Macro
Hello.

That parameters seems to be a property name of given TreeNode object. For example, if I want to get culture code for current document, I use:
{%CurrentDocument["DocumentCulture"]%}

Best Regards,
Radek Macalik

User avatar
Certified Developer v6
Certified Developer v6
szarouski - 10/22/2012 11:50:34 AM
   
RE:Documents[] Macro
Hey, sorry if I wasn't clear. I'm talking particularly about 'Documents' macro. As long as I know it takes two parameters - string and number. String should be a nodealiaspath so that you can retrieve particular node. I assumed that number would be a nodeid, but it looks like it is something else as it didn't work in my case (see example above when I tried to get root node using id 1, but got some other node).
So I'm trying to find out what number parameter 'means' for 'Documents' macro, what 'Documents' macro expects it to be. It is not nodeid, right? Then what it is?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 11/1/2012 7:39:27 AM
   
RE:Documents[] Macro
Hello.

I tried to debug it but when I used second parameter in Documents[] object, it says that an indexer can have only one parameter. Could you please clarify where you can see that second parameter? I am not quite sure about it at the moment. Thank you.

Best Regards,
Radek Macalik

User avatar
Certified Developer v6
Certified Developer v6
szarouski - 11/1/2012 8:15:29 AM
   
RE:Documents[] Macro
Sorry I didn't mean second parameter, I only trying to find out what number mean as a parameter:
User image

User avatar
Certified Developer v6
Certified Developer v6
szarouski - 11/1/2012 8:23:31 AM
   
RE:Documents[] Macro
Sorry for confusion again, I re-read what I wrote:
As long as I know it takes two parameters - string and number

Should be:
As long as I know it takes either string or number


User avatar
Kentico Support
Kentico Support
kentico_radekm - 11/9/2012 7:49:44 AM
   
RE:Documents[] Macro
Hello.

When you use string, it's node alias path of the given TreeNode. When you use an integer number, it's order (index number) of the given TreeNode in the TreeNodeCollection.

Best Regards,
Radek Macalik