Access to "URL extensions" property of page's url from Kentico API

Targutai Yesugei asked on October 24, 2017 12:39

Hi! How to set "URL extensions" property of page, which can be found in Pages -> concrete page -> "URLs" tab -> "Extended properties" via Kentico API?

Thanks in advance.

Correct Answer

David te Kloese answered on October 24, 2017 12:57

Use the following properties: "DocumentUseCustomExtensions" and "DocumentExtensions"

See examples:

and use:

page.SetValue("DocumentExtensions", ".pdf");
page.SetValue("DocumentUseCustomExtensions", true);

although I'm pretty sure you can set them directly

node.DocumentExtensions = ".pdf";
node.DocumentUseCustomExtensions = true;
2 votesVote for this answer Unmark Correct answer

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