3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1522 Views |
-
If variable is blank

29 April 2009 at 5:38pm
Hi everyone,
I am building a site right now, that has a place for a user to enter custom content into their sidebar. This content shows up inside a custom div, with a background image.
Is there a way, inside my templates, that I can essentially say "only if this content has been entered in the CMS (field is not blank/not NULL), than show this variable, else, ignore it?"
-
Re: If variable is blank

29 April 2009 at 5:43pm
Nevermind, I figured this out. For anyone else who may need this, here is the code, assuming you're working with the variable called SidebarContent
<% if SidebarContent %>$SidebarContent<% end_if %>
Notice that the <% if SidebarContent %> does not contain a dollar sign ($), this is what was messing me up.
| 1522 Views | ||
|
Page:
1
|
Go to Top |
