SaaS CMS has officially launched! Learn more now.

Santosh Achanta
May 24, 2018
  1982
(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 release SaaS CMS

Discover the future of content management with Optimizely SaaS CMS. Enjoy seamless updates, reduced costs, and enhanced flexibility for developers...

Andy Blyth | Jul 17, 2024 | Syndicated blog

A day in the life of an Optimizely Developer - London Meetup 2024

Hello and welcome to another instalment of A Day In The Life Of An Optimizely Developer. Last night (11th July 2024) I was excited to have attended...

Graham Carr | Jul 16, 2024

Creating Custom Actors for Optimizely Forms

Optimizely Forms is a powerful tool for creating web forms for various purposes such as registrations, job applications, surveys, etc. By default,...

Nahid | Jul 16, 2024

Optimizely SaaS CMS Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024