Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Advice on ajax-dashboard.php validation

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
ConligWX
Posts: 1573
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Advice on ajax-dashboard.php validation

Post by ConligWX »

I have added BT Sager forecasting to my ajax-dashboard.php but i am getting a validation error on line 971. I do not think the code to include the code is correct for validation fails on any Saratoga templated site.

script and code is available from here: https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=9901

Code: Select all

Error Line 854, Column 57: document type does not allow element "p" here; missing one of "th", "td" start-tag
… align = "center" style = "line-height : 1.3"><b>12-24 Hour Forecast:</b><br />
✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
file is attached. could someone please help in fixing this issue. I'm not too sure how to add additional code into this to fix it.

Thank you.
You do not have the required permissions to view the files attached to this post.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
jdc
Posts: 142
Joined: Tue 19 Jun 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10
Location: Portsoy,.
Contact:

Re: Advice on ajax-dashboard.php validation

Post by jdc »

I think you just need to ensure your

Code: Select all

<p align = "center" style =....
is within

Code: Select all

<td>  </td>
tags.
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Advice on ajax-dashboard.php validation

Post by mcrossley »

As John said, you have the forecast output outside the table cell tags <td></td>....

Code: Select all

<tr>
    <p align="center" style="line-height : 1.3"><b>12-24 Hour Forecast:</b><br />
        <a href="bt-sager.php" style="text-decoration:none;" target="_blank"><b><font color = "#FF0000" face = "Tahoma" size = "2">Increasing cloudiness or overcast possibly followed by rain or showers; Moderate to Fresh Breeze (13-24 mph) Southeast or South winds.</font></b></a></p>
    <td class="data1" style="width: 80px;font-size: 8pt;border: none;text-align: center" valign="middle" align="center"><strong>Saturday<br/><img src="./forecast/images/sct.jpg" width="55" height="58"
alt="Sun and clouds mixed" title="Sun and clouds mixed"/><br/>Sun and clouds mixed</strong><br /><span style="color: #ff0000;">18&deg;C</span></td>
    <td style="width: 504px;" class="data1"><b>WU forecast:</b> Sun and clouds mixed. Humid. High 18C. Winds SSE at 15 to 25 km/h.<br />
        <b>Davis VP+ forecast:</b> <span style="color: green; font-size:9pt">Mostly cloudy and cooler. Precipitation possible within 12 hours, possibly heavy at times. Windy.</span></td>
</tr>
User avatar
ConligWX
Posts: 1573
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: Advice on ajax-dashboard.php validation

Post by ConligWX »

mcrossley wrote:As John said, you have the forecast output outside the table cell tags <td></td>
That's is due to the instructions in BT Sager's initial post.

I'm not at home yet but will add the TD to the line, though I think I already had tried that. It totally messed up the formating.

Hense me asking for help ;)
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Advice on ajax-dashboard.php validation

Post by mcrossley »

You don't need to add a <td> - that would screw things up. You need to move the sager script so it appears within the existing <td> tags...

Currently...

Code: Select all

<tr>
    <p>
        ###sager###
    </p>
    <td>
        ....
    </td>
    <td>
        ...
    </td>
<tr>
Should be...

Code: Select all

<tr>
    <td>
        <p>
           ###sager###
        </p>
        ....
    </td>
    <td>
        ...
    </td>
<tr>
User avatar
ConligWX
Posts: 1573
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: Advice on ajax-dashboard.php validation

Post by ConligWX »

Thanks guys for your help. Managed to place the Sager Forecast within the WU and Davis Forecasts for the day. looks better too now. and passes Validation. :clap:


Capture.JPG
You do not have the required permissions to view the files attached to this post.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Advice on ajax-dashboard.php validation

Post by mcrossley »

Now you just need to convert the script to output wind speeds in km/h ;)
User avatar
ConligWX
Posts: 1573
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: Advice on ajax-dashboard.php validation

Post by ConligWX »

mcrossley wrote:Now you just need to convert the script to output wind speeds in km/h ;)
lol - I still love Imperial Speeds ;)
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
Post Reply