
December 4th, 2012, 12:40 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 1
Time spent in forums: 14 m
Reputation Power: 0
|
|
|
Other - Need Help Formating If/Or Statement
I am in desperate need of help. I have never done Javascript until about 2 weeks ago. I was able to fix a code to get the top bar of my page to open some links in a new window but I need for multiple to stay in the browser but so far this code only allows for one to do that. I am perplexed as to how I should write the If/Or code for this:
Code:
<ul id="toptoolbarlinklist"><{foreach key=key item=_item from=$_widgetContainer}><{if $_item[displayinnavbar] == '1'}><li<{if $_item[isactive] == true}> class="current"<{/if}>>
<{if $_item[defaulttitle] != 'Knowledgebase'}>
<{else if $_item[defaulttitle] == 'Learning Portal Login'}>
<{else if $_item[defaulttitle] == 'Update Contact Information'}>
<{else if $_item[defaulttitle] == 'Contact Us'}>
<a class="toptoolbarlink" style="<{if $_item[defaultsmallicon] != ''}>background-image: url(<{$_item[defaultsmallicon]}>);<{/if}>" href="<{$_item[widgetlink]}>"><{$_item[defaulttitle]}></a>
<{/if}>
<{if $_item[defaulttitle] != 'Knowledgebase'}>
<a class="toptoolbarlink" style="<{if $_item[defaultsmallicon] != ''}>background-image: url(<{$_item[defaultsmallicon]}>);<{/if}>" href="<{$_item[widgetlink]}>" target="_blank" ><{$_item[defaulttitle]}></a>
</li><{/if}><{/foreach}></ul>
For
Code:
<{if $_item[defaulttitle] != 'Knowledgebase'}>
I need for two links to not open in a new window. So in addition to "Knowledgebase" I also need "Home" to stay within the browser.
I have tried to change 2 the lines to:
Code:
<{if $_item[defaulttitle] != 'Knowledgebase' || 'Home' }>
and this causes all links to open a new window.
When I change them to:
Code:
<{if $_item[defaulttitle] != 'Knowledgebase' && 'Home' }>
only the first link which is "Knowledgebase" stays in the browser but I also need home to do the same. Any suggests???
|