Note
- most things you want to do is possible using CSS and the existing classes
- investigate using CSS before using conditionals because CSS is faster
Description
Show use of conditional expressions with multiple terms.
Source code
show_menu2(0, SM2_ROOT, SM2_ALL, SM2_TRIM|SM2_PRETTY,
'<li class="[class]">'.
'[if( id == current || class == menu-expand ){ <b>}][if(id==current){ <i>}]'.
'[a][menu_title][/a]'.
'[if( id == current || class == menu-expand ){ </b>}][if(id==current){ </i>}]'
);
'<li class="[class]">'.
'[if( id == current || class == menu-expand ){ <b>}][if(id==current){ <i>}]'.
'[a][menu_title][/a]'.
'[if( id == current || class == menu-expand ){ </b>}][if(id==current){ </i>}]'
);
Example results
Note
This is an example of conditional output only. This same result is better obtained (fast, efficient) using CSS to style the menu with the pre-existing classes.
.menu-current { font-weight: bold; font-style: italic; } .menu-expand { font-weight: bold; }