Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Get ID from URL macro View modes: 
User avatar
Member
Member
wessel.peeters-ibl-software - 12/12/2013 6:14:58 AM
   
Get ID from URL macro
Hello,
Im having the following problem.
I would like to get the node (214) out of a URL

Example: node=214
producten/detail/214?productguid=1b1c351a-545b-4408-8896-f24407069f77

How could i use a macro that wil do the trick ?

Best regards,


User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 12/12/2013 6:29:09 AM
   
RE:Get ID from URL macro
Hello Wessel,

Isn't the number 214 in the URL the node name? Can you use this macro?

{% CurrentDocument.NodeName %}


Regards,
Josef

User avatar
Member
Member
wessel.peeters-ibl-software - 12/12/2013 7:19:23 AM
   
RE:Get ID from URL macro
Thank you for your message.

The macro {% CurrentDocument.NodeID %} isn't unique for every document only unique for the documentype.

How can i get a unique ID in a macro from every submitted document ?

Maybe something like ItemID ?

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 12/12/2013 8:26:35 AM
   
RE:Get ID from URL macro
Hello Wessel,

I'm sorry, but I don't think follow. Could you give me more details on how you are working with this URL? Are you creating it using macro, or are you accessing it and want to read its value using macro?

When it comes to URLs, the "214" in this case would be the document name:

producten/detail/214?productguid=1b1c351a-545b-4408-8896-f24407069f77

In the first post you said the Node parameter that you want to get is also "214". Does that mean the document name and the Node that you want to get is the same?

You can access the DocumentName like this:

{% CurrentDocument.DocumentName %}


Regards,
Josef

User avatar
Member
Member
wessel.peeters-ibl-software - 12/16/2013 2:36:10 AM
   
RE:Get ID from URL macro
Thank you for your help.
It was like you said the same parameter.