Kentico 10 Documents macro isn't working

Dragoljub Ilic asked on February 22, 2017 13:47

Hello,

I have issue with kentico 10 Documents macro. I tried like this:

{% Documents["/Home"] %}

and

{% Documents.Where("NodeAliasPath='/Home'").FirstItem %}

But in both cases I don't get any results (like that page doesn't exist) -> Always returns NULL. If I try to run this two macros in System -> Macros -> Console, then everything works perfect (I have this page with this node alias path in DB) but I can't get any results on my page.

Already tried:

  • Clear cache
  • Restart application
  • Sign all macros as Global Administrator

Other macro methods works fine, I have issue only with this one.

Thanks, Dragoljub

Correct Answer

Jan Hermann answered on February 22, 2017 15:17

There was a bug in Document collection. Please apply at least hotfix 10.0.4.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Trevor Fayas answered on February 22, 2017 15:08 (last edited on March 24, 2018 12:15)

It's possible that you need to use a signed macro ( {% %} ) as i think the Document access requires it.

I could be wrong, but i know sometimes a macro only works when signed.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 22, 2017 15:21

As Jan stated, there was a bug and fixed in 10.0.4. I found this and reported it on a 10.0.2 instance where I was using macros for the document page titles. Once I applied the hotfix, it was immediately resolved. Has to do with the inheritance of the macros and not automatically inheriting for those items.

1 votesVote for this answer Mark as a Correct answer

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