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 4019) - 03 April 2024

Legacy Cumulus 1 release 1.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

tag problem

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
w5afw
Posts: 154
Joined: Thu 29 Jan 2009 8:48 pm
Weather Station: ws-2315
Location: Houston, the Eagle has landed, TX
Contact:

tag problem

Post by w5afw »

I'm trying to print the temperature #temp twice on one page and the second instance always outputs ??. How can I fix this? Thanks...
W5AFW, Lex

Image
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: tag problem

Post by MarkB »

I just put:

Code: Select all

<#temp><#temp><#temp><#temp>
in the standard indexT.htm file and let Cumulus process and upload it to the web server. The web page dutifully showed:

Code: Select all

12.112.112.112.1
Could you post some more information about your environment?
Image
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: tag problem

Post by steve »

I can't think of any reason duplicated tags shouldn't work, if you have the syntax correct.

Steve
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: tag problem

Post by beteljuice »

I assume you are staying with the AJAX philosophy ?

I haven't inspected the code you are using, but it probably uses unique id substitution. So every 'variable' used on any particular page would have to be unique.
Last edited by beteljuice on Sun 05 Apr 2009 2:18 pm, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: tag problem

Post by MarkB »

This is a snippet from the page

Code: Select all

<head>
  <title>w5afw Weather Station</title>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <!-- **** layout stylesheet **** -->
  <link rel="stylesheet" type="text/css" href="style/style_1col_bottom.css" />
  <!-- **** colour stylesheet **** -->
  <link rel="stylesheet" type="text/css" href="style/colour.css" />
  <script src="prototype.js" type="text/javascript"></script>
  <script type="text/javascript">
//<![CDATA[
    document.observe('dom:loaded', function () {
		var url = 'xmlreturn.php';	
This is based on Ritchie's AJAX implementation. I seem to remember it copes with multiple span occurences by making the span name unique. Try adding '_01' to the temperature span ID to make it unique.

Use:

Code: Select all

<h1><span id="#temp" class="refresh"></span>&nbsp;<span id="#temp_01" class="unit"></span></h1>
In place of:

Code: Select all

<h1><span id="#temp" class="refresh"></span>&nbsp;<span id="_01#temp" class="unit"></span></h1>
This is all from my lousy memory - the correct answer is buried somewhere in the text/comment sections of the code...
Image
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: tag problem

Post by steve »

So this is actually nothing to do with Cumulus tags?

Steve
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: tag problem

Post by MarkB »

steve wrote:So this is actually nothing to do with Cumulus tags?

Steve
Yep - This has nothing at all to do with the Cumulus tags...
Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: tag problem

Post by beteljuice »

Steve - Nowt to do with Cumulus ;)

Mark, as far as I can see all you have done is change the temp UNIT id to an 'illegal' value :shock:

I cannot see the same flexibility for duplicate 'data' values as there is for duplicate 'unit' values.
You would have to get your hands dirty in the script itself :?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
w5afw
Posts: 154
Joined: Thu 29 Jan 2009 8:48 pm
Weather Station: ws-2315
Location: Houston, the Eagle has landed, TX
Contact:

Re: tag problem

Post by w5afw »

trying; still no joy. the first instance:

Code: Select all

		<h1><span id="#location" class="onceonly"></span> Weather<br><br>&nbsp;&nbsp;<span id="#temp" class="refresh"></span><span id="_01#temp" class="unit"></span></h1>
and the second:

Code: Select all

<div class="datacontent">
	  	<h2>Temperature and Humidity</h2>
		<div class="datacontentp">
		<table width="100%">
			<tr class="td_temperature_data">
			    <td>Temperature: <span id="#temp" class="refresh"></span>&nbsp;<span id="_02#temp" class="unit"></span></td>
			    <td>Dew&nbsp;Point: <span id="#dew" class="refresh"></span>&nbsp;<span id="_03#temp" class="unit"></span></td>
		
the test url is:
www.w5afw.com/wx/index.php
W5AFW, Lex

Image
User avatar
w5afw
Posts: 154
Joined: Thu 29 Jan 2009 8:48 pm
Weather Station: ws-2315
Location: Houston, the Eagle has landed, TX
Contact:

Re: tag problem

Post by w5afw »

is this the problem?

Code: Select all

$$('.onceonly').each(function(staticitem) { 
			staticitem.update('**'); 
  			var staticAjax = new Ajax.Updater(staticitem.id,url,{parameters: {item: staticitem.id, property: 'value'} , method : 'post'});				
		});

Once only use of #temp?
W5AFW, Lex

Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: tag problem

Post by beteljuice »

Right idea (sort of) - it's the limitations of the dynamic call.

Although the static call has the same limitations.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
w5afw
Posts: 154
Joined: Thu 29 Jan 2009 8:48 pm
Weather Station: ws-2315
Location: Houston, the Eagle has landed, TX
Contact:

Re: tag problem

Post by w5afw »

this is most curious... any ideas for a fix?
W5AFW, Lex

Image
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: tag problem

Post by MarkB »

beteljuice wrote:change the temp UNIT id to an 'illegal' value
Strictly speaking the # in the ID makes it an illegal value :!: This is why I developed my own version of the AJAX updater https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=832. This does away with the #, supports multiple use of elements on a page (assuming you 'uniqeify' the id ) and does not require the use of PHP postback. My index page uses the <interval> value twice, as in this extract

Code: Select all

<p>The web site uses JPGraph 2.3.4 to realise the graphs, which are updated every <span class="ajax" id="interval_01"></span>.
Realtime observation data in the tables are updated by Cumulus and Ajax every 15 seconds.
All other pages on the site are updated every <span class="ajax" id="interval_02"></span>.</p>
w5afw - I can't really comment on the AJAX you are using as I don't use it myself, but I do remember seeing some comment within it that made me think it would support multiple tag uses...


Cheers, Mark
Image
User avatar
w5afw
Posts: 154
Joined: Thu 29 Jan 2009 8:48 pm
Weather Station: ws-2315
Location: Houston, the Eagle has landed, TX
Contact:

Re: tag problem

Post by w5afw »

thanks, Mark; I will continue to try; also, when I get time, I'll try your template; cheers, lex
W5AFW, Lex

Image
ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: tag problem

Post by ritchie »

Hey - I just get back from a tour of Europe and get problems in the code :lol:

I just took a quick look at your page - it looks OK, but I suspect there may be an issue in the changes you have made.
You have _06#temp & _07#temp twice on the page, so you may well have plain old #temp there more than once too !

You can have multiple occurences of any tag field you want, as long as each is made unique by prefixing with _xx to each, whe xx is the unique value, it can be whatever you want.
My current code has dispensed with the # character for compliance, so I will have to go back a revision to see how it went originally.

The difference between the span classes, is to reduce some of the overhead. Once only is just that, it gets the data once when the page loads, the other, refresh, gest the value and sets up the refresh interval, and unit is the same as static, except it is getting the unit content for the value.

Take a look at pe19.station-weather.co.uk/ajaxindex.htm but I haven't made the latest PHP for the server available yet

I'll have some more time later this week for help if you need it.
Image
Post Reply