WXforum.net

Web Weather => Weather Web Site Help => Topic started by: raindog on October 10, 2018, 11:56:02 PM

Title: Can I modify the displayed data read from a WeatherLink tag?
Post by: raindog on October 10, 2018, 11:56:02 PM
On a weather page I just made (actually a heavily edited WeatherLink template), the two wind speed readings on my page have a decimal and a zero after the whole number. They always display a zero and never the actual value so I would like to remove the decimal point and zero if possible or make it round the number off. Is there a way to do this? My station on WeatherLink's bulletin page doesn't display the decimal and tenths. The tag is
<!--windSpeed-->.
Title: Re: Can I modify the displayed data read from a WeatherLink tag?
Post by: Jasiu on October 11, 2018, 09:47:06 AM
Link?
Title: Re: Can I modify the displayed data read from a WeatherLink tag?
Post by: raindog on October 11, 2018, 10:08:31 AM
http://rosati-mo.com/w
Title: Re: Can I modify the displayed data read from a WeatherLink tag?
Post by: R_o_B on October 15, 2018, 11:14:37 AM
Which programming language is used by the template? Is the template written in PHP?
Title: Re: Can I modify the displayed data read from a WeatherLink tag?
Post by: raindog on October 15, 2018, 11:35:41 AM
It's not PHP. I think it's Java. I really don't know how to build pages. I just know enough to make some changes to existing pages by making comparisons to existing html and searching for answers.
Title: Re: Can I modify the displayed data read from a WeatherLink tag?
Post by: Bushman on October 15, 2018, 03:37:46 PM
You need to modify the .htx file in Weatherlink.  That is used to generate the HTML.  There are several ways to format numbers; JS is the best bet I'd think.
Title: Re: Can I modify the displayed data read from a WeatherLink tag?
Post by: raindog on October 15, 2018, 05:40:19 PM
The htx file is the one I've been working with. Weather Tracker uses the tag below which has number formatting in it but I don't know if WeatherLink allows that.

<td class="data"><!-- wxdata type=wspd unit=mph format="##0.0" --> mph</td>

I've tried to add the number format part and variations of it to WeatherLink's tag but it wouldn't display any reading. I don't know if WeatherLink's tags allow other things to be added within the tag. The line below is the WeatherLink tag I'm working with.

<span class="auto-style14"> <!--windSpeed--></span>&nbsp;Mph</span>
Title: Re: Can I modify the displayed data read from a WeatherLink tag?
Post by: Bushman on October 15, 2018, 11:08:31 PM
I'm not familiar with Weather Tracker, but it appears to have its own syntax.  You can't use that unless it is in the compiler's approved list.  You would have to embed Javascript (or some other processing language) into the HTX so that it is rendered properly in the HMT file. 

Or dump a text file to your server and process that file.
Title: Re: Can I modify the displayed data read from a WeatherLink tag?
Post by: the beteljuice on October 16, 2018, 12:39:02 AM
Try:
Code: [Select]
<script>document.write(parseInt(<!--windSpeed-->));</script>In your .htx file