Santosh Achanta
May 24, 2018
  2011
(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: You cannot submit this form because an administrator has turned off data storage.

Do not let this error message scare you, the solution is quite simple!

Tomas Hensrud Gulla | Oct 4, 2024 | Syndicated blog

Add your own tools to the Optimizely CMS 12 admin menu

The menus in Optimizely CMS can be extended using a MenuProvider, and using the path parameter you decide what menu you want to add additional menu...

Tomas Hensrud Gulla | Oct 3, 2024 | Syndicated blog

Integrating Optimizely DAM with Your Website

This article is the second in a series about integrating Optimizely DAM with websites. It discusses how to install the necessary package and code t...

Andrew Markham | Sep 28, 2024 | Syndicated blog

Opticon 2024 - highlights

I went to Opticon in Stockholm and here are my brief highlights based on the demos, presentations and roadmaps  Optimizely CMS SaaS will start to...

Daniel Ovaska | Sep 27, 2024