Question

Photo of Greg Leininger

0

CurrentPerson value is always me no matter who logs in.

I've set the home page of the internal website to say, "Welcome to Rock, {{ CurrentPerson.FirstName}}!" Yet, no matter who logs in, it shows my name rather than the logged in user. For instance, when my wife Kristin logs in, the name in the top right corner of the screen will have "Kristin", but the the CurrentPerson.FirstName shows "Greg". Please help.

  • Photo of Arran France

    1

    This is because the HTML block you're using it set up to cache values. If you click on the block configuration button in the bottom right hand corner of your screen, hover over the block, click on the settings gear icon for the block, tab over to the advanced settings' and scroll down to the bottom there's a setting called Output Cache Duration. If you change this to 0 the block will stop caching you as the current person!

    • Jon Horton

      Is there a way to escape variable so they're not cached so that you can get the benefits of caching content channel entries, but allow the {{ CurrentPerson.NickName }} to render uncached?

    • Nick Airdo

      No, there isn't. Once the block content is cached, it's used in its entirety. I would recommend you consider splitting up the cached and non-cached parts into two separate blocks.

  • Photo of Greg Leininger

    1

    Arran, your answer was very close. The Output Cache Duration under the Advanced Settings was already set to 0, so that wasn't the problem. However, under the Basic Settings, I changed the Cache Duration from 3600 to 0. That fixed the problem. Thanks for pointing me in the right direction.