get the folder Name

web dev asked on July 30, 2019 14:58

hello kentico team i have tree of the project like this

      NewsLocation defaultvalue should get locationFolderName

i was trying this macro in defaut value of the field but was not working

{% EditedObject.Parent.DocumentName#%}the value is emtpy on form tab

Correct Answer

Dmitry Bastron answered on July 30, 2019 17:38


Have you filled the default value with Macro correctly? Note this triangle icon:

edit property

All the Macro values should go here:

macro value

And once edited should look like this:


Also note, that the default value will work only for new pages/objects created and will not re-evaluate macros for existing objects if you edit them.

And finally, in your example it will take direct parent name. Here are the results from your example structure:

  • {% EditedObject.Parent.DocumentName |(identity)GlobalAdministrator%} = LocationFolder
0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.