Inserting Document properties into Page Template

Vic Alfred Inting asked on December 11, 2014 11:24

I'm trying to insert the name of the page onto the template but I'm having issues. In the Page template layout properties, I added:

<% CMSContext.CurrentDocument.DocumentName %>

But I get this error:

[Error loading the layout] c:\DWASFiles\sites\aon-affinity\Temporary ASP.NET Files\root\54b07d75\56ec1444\App_Web_8efbb0f0-f234-46d5-b9be-9c22b9c94d3a.ascx.76a317f9.pd9qbfa_.0.cs(280): error CS1002: ; expected

Any ideas?

Correct Answer

Juraj Ondrus answered on December 11, 2014 12:57

Hi,

In Kentico o7 you need to use this markup:

<%= CMSContext.CurrentDocument.DocumentName %>

In Kentico 8 you need to do it through the MacroResolver class and specify the full namespace.

Best regards,
Juraj Ondrus

1 votesVote for this answer Unmark Correct answer

Recent Answers


Vic Alfred Inting answered on December 11, 2014 13:12

Appreciate it Juraj! :)

0 votesVote for this answer Mark as a Correct answer

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