User Defined Menu

From Cumulus Wiki
Revision as of 14:36, 14 April 2021 by HansR (talk | contribs) (Initial edit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

When using the Website Generator the website comes with a standard menu. It is possible to expand this menu by adding items to it. It is not possible to modify the standard menu items or sub-items.

Operation

In the website root there must exist a file CUsermenu.txt which contains the menu. When the index.html is requested by a visitor the file CUsermenu.txt is read and the items in there form the User Defined Menu which is explained below.

Output

There is no output of the user menu, only a visible appearance on the website.

Inifile parameters

There are no inifile parameters involved

Inner working

The website is designed on the basis of the Bootstrap Toolkit. As a result, the menu is also within this toolkit.

Example of CUsermenu.txt

Below is the contents of CUsermenu.txt of HansR. All possibilities are used in that file and you can copy the basic principle replacing the links by your own.

NOTE: Sub-menu within a drop down is not possible.

You can use the following possibilities:

  1. Create a direct link with a <a> tag. Use target="_blank" for a new tab or window otherwise your site will be overwritten
  2. Loading a site or report of yourself into the Report View Area using the CumulusUtils function LoadUtilsReport()
  3. Create a divider between menu items
 <li class='nav-item dropdown'>
    <a class='nav-link dropdown-toggle' href='#' id='navbarDropdown' role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
      NL
    </a>
    <div class='dropdown-menu' aria-labelledby='navbarDropdown'>
      <a class='nav-link' href="https://topotijdreis.nl" target="_blank">Topo NL</a>
      <a class='nav-link' href="https://waterinfo.rws.nl/#!/kaart/waterhoogte-t-o-v-nap/" target="_blank">Waterstanden NL</a>
      <a class='nav-link' href="https://vaarweginformatie.nl/frp/main/#/home" target="_blank">Waterwegen NL</a>
      <span class='nav-link' onclick="LoadUtilsReport('Ahn.txt');">Hoogtekaart NL</span>
      <!-- div class='dropdown-divider'></div -->
    </div>
  </li>
  
  <li class='nav-item dropdown'>
    <a class='nav-link dropdown-toggle' href='#' id='navbarDropdown' role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
      Extra
    </a>
    <div class='dropdown-menu' aria-labelledby='navbarDropdown'>
      <span class='nav-link' onclick="LoadUtilsReport('Sat24-zonwolken.txt');">Sateliet</span>
      <span class='nav-link' onclick="LoadUtilsReport('Sat24-infrarood.txt');">Infrarood</span>
      <span class='nav-link' onclick="LoadUtilsReport('Radar-regen.txt');">Radar</span>
      <span class='nav-link' onclick="LoadUtilsReport('Blitzortnung.txt');">Blitzortnung</span>
      <span class='nav-link' onclick="LoadUtilsReport('MeteoAlarm.txt');">Meteo Alarm</span>
      <a class='nav-link' href='https://effis.jrc.ec.europa.eu/static/effis_current_situation/public/index.html' target="_blank">Effis</a>

      <div class='dropdown-divider'></div>

      <span class='nav-link' onclick="LoadUtilsReport('GlobalWinds.txt');">Global Winds</span>
      <span class='nav-link' onclick="LoadUtilsReport('Windy.txt');">Windy</span>
      <span class='nav-link' onclick="LoadUtilsReport('WXcharts.txt');">WXcharts</span>

      <div class='dropdown-divider'></div>

      <a class='nav-link' href="https://cumulus.hosiene.co.uk/viewforum.php?f=44" target="_blank">Forum</a>
      <a class='nav-link' href="https://meteo-wagenborgen.nl/wp/" target="_blank">The Blog</a>
    </div>
  </li>

User report shown in the Report View Area

Any user report or external website can be shown in the Report View Area by simply loading the User Report in that area with the LoadUtilsReport function with a span-tag as below:

 <span class='nav-link' onclick="LoadUtilsReport('User report name.txt');">Sateliet</span>

URL shown in the Report View Area

The Report View Area can contain reports but maybe you would like to see a website in that area. That can be accomplished by putting that URL in an IFrame text file and to load that IFrame with a call to the LoadUtilsReport function like e.g. for Windy below:

 <span class='nav-link' onclick="LoadUtilsReport('Windy.txt');">Windy</span>

Where Windy.txt is a plain text file containg the following:

 <iframe src="The Embedded URL given by Windy" width="100%" frameborder="0" style="border:0;height:75vh;"></iframe>

The width definition of the IFrame guarantees it won't fall beside the window, the height definition keeps most URLs within the given viewport. Some may get higher which happens often when you are using a tablet. Creating dynamic sizing within the available viewport is however a bit beyond the scope of this exercise as most site work fine like this. Of course you could experiment yourself with the IFrame parameters. Look on the map for examples how users create their menu's, some really do great things!