Logged Out
Create an Account
Login:
Password:

Forgot your password?
<!--System:IfMenus-->

View Version History
The <!--System:IfMenus--> command typically works in tandem with the <!--System:Menus--> command.

It's purpose is to display whatever is between <!--System:IfMenus--> and <!--System:EndIfMenus--> if there are menus configured on the left or right side of the Menu Administration section.

To demonstrate, lets say you are laying out your site with tables, like the following (very simplified) example:

<table style="width:100%">
	<tr>
		<td style="width:150px"><!--System:Menus:Left--></td>
		<td><!--System:Content--></td>
		<td style="width:150px"><!--System:Menu:Right--></td>
	</tr>
</table>


This layout will work perfectly if you have menus on both sides. If, however, you only have menus on the left, then the right side would simply show as

<td style="width:150px"></td>


which would simply be a big blank space on the right side of your screen. This is generally undesirable. This is where the IfMenus function comes in

If we modified the code to look like this:

<table style="width:100%">
	<tr>
		<!--System:IfMenus:Left-->
			<td style="width:150px"><!--System:Menus:Left--></td>
		<!--System:EndIfMenus-->

		<td><!--System:Content--></td>

		<!--System:IfMenus:Right-->
			<td style="width:150px"><!--System:Menu:Right--></td>
		<!--System:EndIfMenus-->
	</tr>
</table>


Then that entire problem would be averted. This will prevent the right <td> from displaying if there are no right menus, and if will prevent the left <td> from dipllaying if there are you left menus.

Incoming Guide Links
  • Layout File


  • Last Modified: 4/2/2008 11:25am
    Contributors: Chops
    Easy Link
    BBCode Link: [guide=SystemIfMenus][/guide]
    URL: http://dkpsystem.com/guide/SystemIfMenus