Page 1 of 1

Website webtags

Posted: Fri 26 Mar 2021 2:07 pm
by Pirate3000
Hi all
There is going to be a simple answer for this question.
I'm trying to get a new weather website updated ready for the new weather station going into place when the workshop is all finished.
I'm using the latest cumulus mx and have noticed that the tags have changed in the index.htm.

Example
old: - #sunrise - Sunrise

New: cmxdata="sunrise - Sunrise

do you have to use the new format or still the old one.
Thanks for help as always... :D

Re: Website webtags

Posted: Fri 26 Mar 2021 2:19 pm
by ConligWX
the new format of webpages does not use webtags as such. it uses the /websitedata.json file. unless you are using the old legacy webpages

more info here: https://cumuluswiki.org/a/New_Default_W ... nformation

Re: Webtags site

Posted: Mon 29 Mar 2021 7:37 am
by meteo19
Hello

New CumulusMX template install the problem I'm encountering is for webtags that incorporate an example image newrecord . Until now I was making a call.

<img src"images/Record<#newrecord>.gif"alt"O" width-"14" title"Led flashing new record-click to see the records "align"absmiddle" >

But now or place the <span data-cmxdata"newrecord"></span> to get image. I integrate newrecord into websitedataT.json.

Thanks for ideas :?: :groan:

Patrick

http://www.meteosegur.fr/CumulusMX/index.htm

Re: Website webtags

Posted: Mon 29 Mar 2021 8:53 am
by mcrossley
You will have to add the <#newrecord> tag intp your websitedataT.json file, then add some custom JavaScript to set the <img> src filename.

Something like...

Code: Select all

<img id="newRecord" src="" alt="O" .....>
Then...

Code: Select all

$(document).ready(function() {
	dataLoadedPromise.then(function() {
		$('#newRecord').attr('src', 'images/Record' + cmx_data.newRecord + '.gif');
	});
});
With the JS code being called on the data load Promise fulfilment like the menu.js code.

** All code untested **

Re: Website webtags

Posted: Mon 29 Mar 2021 9:20 am
by meteo19
Thanks Mark it works bravO to you. I had no more ideas. :clap: :clap:

Re: Website webtags

Posted: Mon 29 Mar 2021 10:14 am
by mcrossley
:thumbsup: