Try our conversational search powered by Generative AI!

Santosh Achanta
May 24, 2018
  1941
(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
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

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog