|
1. In my Layout.cshtml I got the following code:
@if (Model.Featured != null) {
<section id="promo" class="section alt">
<div class="container">
@Zone(Model.Featured)
</div>
</section>
}
2. In my Placement.info I got the following placement
<Place Fields_Common_Text-MyField="/Featured:2" />
So basically I configure the custom field "MyField" to render in the "Featured" zone .
If I have a page where I do not provide any value for "MyField" the "Featured" zone gets rendered anyway. I assume this happens because the value of MyField is an empty string rather than null...
Is there any way to avoid this behaviour? What I would like is to keep the placement definition like stated, however, when I do not provide a value for MyField the Featured zone should not be rendered.
is there a way to add perhaps additional checks?
PS: working in webmatrix here
|