Difference between revisions of "MediaWiki:Menu.rythm"
Jump to navigation
Jump to search
| Line 11: | Line 11: | ||
// a menu | // a menu | ||
class Menu { | class Menu { | ||
| − | + | String homeUrl; | |
| + | String iconUrl; | ||
| + | |||
| + | public Menu(String homeUrl,String iconUrl) { | ||
| + | this.homeUrl=homeUrl; | ||
| + | this.iconUrl=iconUrl; | ||
| + | } | ||
} | } | ||
| + | |||
| + | class MenuItem { | ||
| + | } | ||
} | } | ||
@def showMenu(Menu menu) { | @def showMenu(Menu menu) { | ||
| + | <nav class="navbar"> | ||
| + | <div class="container"> | ||
| + | <div class="navbar-header"> | ||
| + | <button type="button"> | ||
| + | <span class="icon-bar"></span> | ||
| + | <span class="icon-bar"></span> | ||
| + | <span class="icon-bar"></span> | ||
| + | </button> | ||
| + | <a class="navbar-brand" href='@(menu.homeUrl)'> | ||
| + | <img src='@(menu.iconUrl)' style="max-height:7vh; margin-top: -2vh;" > | ||
| + | </a> | ||
| + | </div> | ||
| + | </div> | ||
| + | </nav> | ||
} | } | ||
</source> | </source> | ||
[[Category:RythmTemplate]] | [[Category:RythmTemplate]] | ||
Revision as of 08:27, 9 November 2017
Links
- MediaWiki:Bootstrap.rythm
- MediaWiki:Form.rythm
- https://www.w3schools.com/bootstrap/bootstrap_ref_comp_glyphs.asp
Rythm template source
@// Rythm template for Bootstrap menu
@// field definitions
@def static {
// a menu
class Menu {
String homeUrl;
String iconUrl;
public Menu(String homeUrl,String iconUrl) {
this.homeUrl=homeUrl;
this.iconUrl=iconUrl;
}
}
class MenuItem {
}
}
@def showMenu(Menu menu) {
<nav class="navbar">
<div class="container">
<div class="navbar-header">
<button type="button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href='@(menu.homeUrl)'>
<img src='@(menu.iconUrl)' style="max-height:7vh; margin-top: -2vh;" >
</a>
</div>
</div>
</nav>
}