8.1 macro issue

lawrence whittemore asked on August 29, 2014 21:51

{%Documents["/" + CurrentDocument.NodeAliasPath.Split("/")[1]].DocumentName #%} This seems to no longer work in 8.1

You have to add this to the web config for it to work in earlier versions.

I get this error "Security check of the expression 'Documents["/" + CurrentDocument.NodeAliasPath.Split("/")[1]].DocumentName |(user)administrator|(hash)71f68020f9d1b82e581ce79a905cec9e5e5331c5599951a5737a3a53317d5757' didn't pass. The expression was signed by user 'administrator'. Remove the signature and re-save the expression by a user with proper permissions."

Recent Answers

lawrence whittemore answered on August 29, 2014 22:01

I figured it out. Had to remove the # sign. not sure why...

0 votesVote for this answer Mark as a Correct answer

Yehuda Lando answered on August 29, 2014 22:16

Make sure to resign your macros. See here at the macros section

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 3, 2014 13:57

You might check into the Macro Signatures documentation. In there, it talks about having a key in your web.config that is used at the hash string salt. If this key doesn't exist, then the database connection string is used as a hash string salt. So if you change your connection string then all of your signed macros become invalid and you have to resign your macros as Yehuda mentions. One way to not sign your macros is to use an @ symbol prior to closing the macro. {% CurrentDocument.NodeAliasPath @%}

1 votesVote for this answer Mark as a Correct answer

Vinod Vutla answered on May 25, 2018 05:30

When you write a macro it will be enclosed with an encrypted has value. A hash will be created based on the salt key and the current user who writes the macro. So following reasons could help you out fix the root cause of marco resolver errors.

  1. One reason would be the change in your salt key as Brenden explained in his answer. Make sure you maintain a same salt key in your config file across the instances
  2. Admin User which you have used to write macros not present in your Live Kentico instance. Make sure you have the same admin accounts(who writes code) in all of your instances.

Thanks VinodV

0 votesVote for this answer Mark as a Correct answer

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