Try our conversational search powered by Generative AI!

Santosh Achanta
May 24, 2018
  1946
(6 votes)

Correction to no wrappers content area renderer


Referring to Krzysztof Morcinek's blog post which is used quite a lot in the epi world, thought to share a small correction to it.

The below piece of code from the blog post renders all the items while you're in edit mode which doesn't allow users to test personalized content.

_contentRequestContext.IsInEditMode(helper.ViewContext.HttpContext)
? contentArea.Contents
: contentArea.FilteredContents

So, this piece of code can be safely replaced with the below which will just render the same items rendered by the out of the box content area renderer which allows users to test how personalized content looks like.
contentArea.FilteredItems


Image Untitled.png
May 24, 2018

Comments

valdis
valdis May 24, 2018 11:12 AM

btw, just a side note - this lib (https://github.com/valdisiljuconoks/EPiBootstrapArea) does the same thing and lot more. maybe worth to checkout and reduce code on project's side :)

Please login to comment.
Latest blogs
Optimizely Forms - How to add extra data automatically into submission

Some words about Optimizely Forms Optimizely Forms is a built-in add-on by Optimizely development team that enables to create forms dynamically via...

Binh Nguyen Thi | Apr 29, 2024

Azure AI Language – Extractive Summarisation in Optimizely CMS

In this article, I demonstrate how extractive summarisation, provided by the Azure AI Language platform, can be leveraged to produce a set of summa...

Anil Patel | Apr 26, 2024 | Syndicated blog

Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog