Im on Expression engine 7 now. Im trying check template variable for condition. like so:

{if site_logo_path != ""}
    <img src="{site_logo_path}">
    <h1>Site Name</h1>

Im tryed:

{if {site_logo_path} != ""}
{if "{site_logo_path}" != ""}
{if '{site_logo_path}' != ""}

No one is working correctly. If site_logo_path is empty string or url always displays second rule with h1.

Thanks for your attention. Regards.

3 Answers 3


Does your {site_logo_path} is a normal variable or it come from a layout:set?

Did you try {if !site_logo_path} ?

  • Thanks for ypur reply. Its normal template variable and i use it in layout. And yes, im tried that.
    – soulilya
    Commented Feb 14 at 18:51
  • Does {site_logo_path} output something by itself?!
    – Benoit L
    Commented Feb 15 at 19:42

Where is {site_logo_path} coming from?

Is it a layout variable?

{layout:set name="site_logo_path"}/some/path/file.png{/layout:set}

If so you would use in your if statement:


Is it a channel field?

{exp:channel:entries channel="some_channel"}

If so, it needs to be wrapped in a channel entries loop like above.

Is it a global template variable?

Then what you have tried should've worked.

Is it a template partial?

Then I don't think you can evaluate it in an if statement.


If it's like you want to show path then you can try this

{if site_logo_path && site_logo_path != ""}
Your condition to show logo
show else 

This should do the trick. If this does not work, let me know what is your purpose and I will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.