I have an item item1 in sitecore with redering rendering1 in its presentation details. The rendering rendering1 has its datasource and is a controller rendering. The datasource of the rendering one is personalized. In the corresponding action method of the rendering, I am comparing the templateid of the item1 to a constant and setting a flag to true if they are equal else setting it to false. (using glassmapper)

var currentItem= _sitecoreContext.GetCurrentItem<Item>();

var templateid=currentItem.TemplateID.ToString()

{condition=true }

We have a nightly job scheduled for full site publish. Every night when the nightly job runs, we start getting this condition as false and when i republish the item again, it start showing true.
This issue is happening only when the personalised condition is met and doesnot happen if it is a default condition i.e. when the item has no datasource. Also, this is not replicable in lower environments.

I have checked the database by switching db in sitecore and the template id for the item shows exactly same as the constant configured by me. Is there anything else, I am supposed to check to resolve this issue

Also, my understanding is that var currentItem= _sitecoreContext.GetCurrentItem(); will give me the current item and not the datasource item of the rendering

In the caching setting of the rendering, I have Cacheable and Vary By Data set to true. Could it be because of caching, but if that is the case, should it not happen on lower environments as well

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.