Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

If Menu(2) Doesn't Exist do This...


Reply


3 Posts   1436 Views

Avatar
AlastairW

Community Member, 5 Posts

15 April 2010 at 9:17am

Hi,

I'm trying to load a stylesheet if Menu(2) doesn't exist:

<% if (!isset(Menu(2))) %>
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="themes/pmb/css/ie7-menu-2-fix.css" />
<![endif]-->
<% end_if %>

However that code obviously isn't right and I can't figure it out. I'm sure its extremely easy but anyone have a tip? My Googling has failed.

Thanks

Avatar
Willr

Forum Moderator, 5513 Posts

15 April 2010 at 4:43pm

Edited: 15/04/2010 4:44pm

In SS templates you can simply do the following. isset() is a PHP function

<% if Menu(2) %>
...
<% else %>
...

Avatar
AlastairW

Community Member, 5 Posts

16 April 2010 at 9:15am

Ahh it was super easy. Cheers Will, that completes the website!