Hi Guys,
Is there any way to check if a template area (dwcontent) has something in it?
I need to show/hide some zreas based on the presence or absence of paragraphs in a template area.
I am using Razor.
Thanks,
Adrian
Hi Guys,
Is there any way to check if a template area (dwcontent) has something in it?
I need to show/hide some zreas based on the presence or absence of paragraphs in a template area.
I am using Razor.
Thanks,
Adrian
Hi Adrian
If you mean the paragraph content I think you can use:
@if (!string.IsNullOrEmpty(GetString("DwContent(paragraphareaname)"))) {
<div class="dwcontent" id="paragraphareaname"></div>
}
Regards Thomas
Hi Thomas,
That's exactly what I needed.
Thanks a lot!
Adrian
You must be logged in to post in the forum