Jump to content

Custom header.tpl menu options


gbensonii

Recommended Posts

I am looking for a way to customize my header.tpl file so that if a given option is not enabled then it doesn't show up in the menu option.

 

For instance - I do not currently allow credit card info to be stored and so I want the template to be able to check to see if credit cards are allowed and if so display the menu option but if not then to not display that menu option.

 

Below is a part of the code I am using:

{if $loggedin}
	<ul class="art-hmenu">
		<li><a href="{if $loggedin}clientarea{else}index{/if}.php">{$LANG.account}</a>
			<ul>
				<li><a href="affiliates.php">{$LANG.affiliatestitle}</a></li>
				<li><a href="clientarea.php?action=details">{$LANG.editaccountdetails}</a></li>
				<li><a href="clientarea.php?action=creditcard">{$LANG.navmanagecc}</a></li>
				<li><a href="clientarea.php?action=contacts">{$LANG.clientareanavcontacts}</a></li>
				<li><a href="clientarea.php?action=addfunds">{$LANG.addfunds}</a></li>
				<li><a href="clientarea.php?action=emails">{$LANG.navemailssent}</a></li>
				<li><a href="clientarea.php?action=changepw">{$LANG.clientareanavchangepw}</a></li>
				<li><a href="logout.php">{$LANG.logouttitle}</a></li>
		  </ul>
		</li>
		<li><a href="#" class="menu">{$LANG.navbilling}</a>
		  <ul>
			<li><a href="clientarea.php?action=invoices">{$LANG.invoices}</a></li>
			<li><a href="clientarea.php?action=quotes">{$LANG.quotestitle}</a></li>
		  </ul>
		</li>
		<li><a href="#" class="menu">{$LANG.navdomains}</a>
		  <ul>
			<li><a href="clientarea.php?action=domains">{$LANG.clientareanavdomains}</a></li>
			<li class="divider"></li>
			<li><a href="cart.php?gid=renewals">{$LANG.navrenewdomains}</a></li>
			<li><a href="cart.php?a=add&domain=register">{$LANG.navregisterdomain}</a></li>
			<li><a href="cart.php?a=add&domain=transfer">{$LANG.navtransferdomain}</a></li>
			<li class="divider"></li>
			<li><a href="domainchecker.php">{$LANG.navwhoislookup}</a></li>
		  </ul>
		</li>
		<li><a href="#" class="menu">{$LANG.navservices}</a>
		  <ul>
			<li><a href="clientarea.php?action=products">{$LANG.clientareanavservices}</a></li>
			<li class="divider"></li>
			<li><a href="cart.php">{$LANG.navservicesorder}</a></li>
			<li><a href="cart.php?gid=addons">{$LANG.clientareaviewaddons}</a></li>
		  </ul>
		</li>
		<li> <a href="support.php">{$LANG.navsupport}</a>
		  <ul>
			<li><a href="downloads.php">{$LANG.downloadstitle}</a></li>
			<li><a href="knowledgebase.php">{$LANG.knowledgebasetitle}</a></li>
			<li><a href="serverstatus.php">{$LANG.networkstatustitle}</a></li>
			<li><a href="supporttickets.php">{$LANG.navtickets}</a>
				<ul>
				<li><a href="submitticket.php">{$LANG.navopenticket}</a></li>
				</ul>
			</li>
		</ul>
		</li>
	</ul>

{else}

 

So the real question I have is this - What, if any, IF / ELSE statement could be used to hide the

<li><a href="clientarea.php?action=creditcard">{$LANG.navmanagecc}</a></li>

when not enabled?

Link to comment
Share on other sites

not sure if this would help but in the template clientareadetailslinks.tpl it uses this to determine if a client can edit cc details

 

[b]{if $condlinks.updatecc}[/b] | [b]{if $clientareaaction eq "creditcard"}[/b]<strong>{$LANG.clientareanavchangecc}</strong>{else}<a href="{$smarty.server.PHP_SELF}?action=creditcard">{$LANG.clientareanavchangecc}</a>[b]{/if}{/if}[/b]

 

and in v4 it used the following (it should still work?)

 

[b]{if $ccenabled}[/b] | <a href="{$smarty.server.PHP_SELF}?action=creditcard">{$LANG.clientareanavchangecc}</a>[b]{/if}[/b]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated