Author Topic: Flyout Menu  (Read 464 times)

0 Members and 1 Guest are viewing this topic.

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 440
    • Penn Lake Weather
Flyout Menu
« on: December 31, 2019, 05:10:45 PM »
Hi All and glad your back up KEN!!

So - Quickly
https://www.pennlake.us/     Radar

All I am trying to do is change the links in the Radar  -- State College and Mt Holly
Example - change link in State College to "https://radar.weather.gov/ridge/radar_lite.php?rid=CCX&ampproduct=NCR&ampoverlay=11101111&loop=yes" and I get this

XML error: EntityRef: expecting ';' at line 44

Here is a snippet of the code if anyone has any Ideas or needs more info LMK.

-->
<menu>
   <item caption="Home" link="index.php" title="Home Page"/>
   <item wxonly="VWS" caption="Mesonet" title="Local Weather Exchange Stations" link="wxmesonet.php"/>
   <item caption="Radar">
              <item caption="Combined Radar" link="https://www.pennlake.us/wxmultiradars.php" title="Combined Radar" target="_blank"/>
               <item caption="Radar by Region" link="https://www.pennlake.us/radarbyregion.php" title="Radar by Region" target="_blank"/>
             <item caption="Water Vapor" link="https://www.weather.gov/satellite" title="Water Vapor" target="_blank"/>
             <item caption="Binghamton NY" link="https://radar.weather.gov/ridge/Conus/northeast_loop.php" title="NE Radar" target="_blank"/>   
              <item caption="State College PA" link="https://radar.weather.gov/ridge/radar.php?rid=ccx&amp;amp;product=N0R&amp;amp;overlay=11101111&amp;amp;loop=yes" title="Radar" target="_blank"/>
            <item caption="Mount Holly NJ" link="https://radar.weather.gov/ridge/radar.php?rid=dix&amp;amp;product=N0R&amp;amp;overlay=11101111&amp;amp;loop=yes" title="MH" target="_blank"/>           
<!--
      <item caption="GRLevel3 Radar" link="wxgr3radar.php" title="NEXRAD Radar using GRLevel3" />
-->
   </item>
<!--
      <item caption="Nearby Buoys" link="wxbuoys.php"/>
-->
   <item caption="Forecast" title="Weather outlook">


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Flyout Menu
« Reply #1 on: December 31, 2019, 05:51:42 PM »
The cited url of
Code: [Select]
https://radar.weather.gov/ridge/radar_lite.php?rid=CCX&ampproduct=NCR&ampoverlay=11101111&loop=yesis not quite valid.. the &amp is missing the ; (semicolon) so should read as
Code: [Select]
https://radar.weather.gov/ridge/radar_lite.php?rid=CCX&amp;product=NCR&amp;overlay=11101111&amp;loop=yesThen it is a valid URL with &amp; -> & when loaded in the browser.  To make it work inside XML (thanks to the XML parser), those &amp; have to be 'escaped' to be &amp;amp; for it all to work correctly.  So the URL becomes
Code: [Select]
https://radar.weather.gov/ridge/radar_lite.php?rid=CCX&amp;amp;product=NCR&amp;amp;overlay=11101111&amp;amp;loop=yes
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 440
    • Penn Lake Weather
Re: Flyout Menu Resolved
« Reply #2 on: December 31, 2019, 06:03:40 PM »
Thanks Ken!!!!

At First I thought it was as simple as cuttng and pasting the url in -- not so.

Also not knowing I did look up the error message, thought i did what you did but I know I didn't do something right, cause mine did not work.

Really glad your back up and running.

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 440
    • Penn Lake Weather
Re: Flyout Menu
« Reply #3 on: January 01, 2020, 11:05:04 AM »
So this is what I missed - I guess it time for either new glasses or more brain food.

111&loop=yes  I didn't see the & inbetween the 111's

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Flyout Menu
« Reply #4 on: January 01, 2020, 07:19:19 PM »
Search for '&' and replace with '&amp;' has always been my go-to method because of old eyes, etc.  I just avoid using 'Replace All' so I can check to see if the replacement is legitimate.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 440
    • Penn Lake Weather
Re: Flyout Menu
« Reply #5 on: January 01, 2020, 09:25:44 PM »
Thanks gwwilk!!! Now only if my old tired mind can remember your tip, lol.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Flyout Menu
« Reply #6 on: January 02, 2020, 03:30:23 PM »
That
Quote
Search for '&' and replace with '&amp;'
works for page HTML for URLS.

Inside flyout-menu.xml (or dropdown-menu.xml) there has to be one more level of escape so

Search for '&' and replace with '&amp;amp;'

there (but only in the .xml file).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything