Page 1 of 1

Display Moon Image with Span

Posted: Tue 19 Jul 2022 9:02 am
by apple8
I have been attempting to duplicate my old Cumulus1 site using using the websitedata.json file uploaded with "extra web files" and then replacing the tags with the "span" command. So far it been going ok with the "today" page completed. I have started on the index page which was going ok until I got stuck on the moon image. I have tried all sorts of combinations on the line below but haven't struck the right one.

Code: Select all

<td rowspan="3"><img src="images/moonphase/"#moonphase".png" alt="Moon" width="64" align="left" border="0" height="64" style="margin: 0px 10px" /></td>
Substituting "#moonphase" with <span data-cmxdata="moonphase"> doesn't seem to work for me.

So I am looking for guidance on how to get the moon image to show.

Re: Display Moon Image with Span

Posted: Tue 19 Jul 2022 12:29 pm
by mcrossley
You will not be able to do that with the standard substitutions in the script, you will have to have a bit of custom js code that takes the phase value and puts that into the Moon image tag - or just use the new moon image :)

Re: Display Moon Image with Span

Posted: Tue 19 Jul 2022 1:05 pm
by apple8
Ok as custom js code is beyond my skill set, the new moon image looks to be the way to go.

Will uploading the moon image via extra web files at end of day and then use similar code from my MX site for moon image work?

Re: Display Moon Image with Span

Posted: Tue 19 Jul 2022 1:09 pm
by mcrossley
You can just tick the FTP option under Internet Settings > Moon Image to have CMX transfer it for you.
Your image src then just needs to point to folder/moon.png

Re: Display Moon Image with Span

Posted: Tue 19 Jul 2022 1:54 pm
by apple8
That is already ticked which I thought was for the MX directory. So using that to point to the weathertest directory I will get the moon image uploaded to both directories if I understand correctly.

Re: Display Moon Image with Span

Posted: Tue 19 Jul 2022 2:08 pm
by mcrossley
No, it will only go to one folder. I didn't realise you had two sites, though you can normally point both sites at the same file?

Re: Display Moon Image with Span

Posted: Tue 19 Jul 2022 3:26 pm
by PaulMy
Hi,
You can also use the Moon Image settings to Copy the file and then add it to the Extra Web Files for FTP at interval or EOD.

Enjoy,
Paul

Re: Display Moon Image with Span

Posted: Wed 20 Jul 2022 8:31 am
by apple8
Thanks Mark and Paul.

I didn't have any success pointing to the MX site moon image or with the copy moon image in internet settings. I was however successful by using Extra Web Files and uploading the moon image from the MX web folder. After checking that it worked ok I ticked EOD and will check again in the morning.

Would the Copy Moon Image file path in internet settings be the same as the destination file path in Extra Web Files. I used /public_html/weathertest/images/moon.png

Re: Display Moon Image with Span

Posted: Wed 20 Jul 2022 9:14 am
by mcrossley
apple8 wrote: Wed 20 Jul 2022 8:31 am Would the Copy Moon Image file path in internet settings be the same as the destination file path in Extra Web Files. I used /public_html/weathertest/images/moon.png
No, the copy path is a local path on your machine running CMX, you cannot use that to FTP to remote machine. It is really intended for people who run their own web server on the same machine as CMX.

Re: Display Moon Image with Span

Posted: Thu 17 Nov 2022 10:22 pm
by grupe
My moon image is not updating. I am lost as to what I must do. I am running the Cumulus MX Template by Neil Thomas 2022.

Re: Display Moon Image with Span

Posted: Thu 17 Nov 2022 11:58 pm
by PaulMy
Hi,
If you have your Internet settings correct to generate and FTP moon.png image to your site, then check your MXdiags. At each hour It should have

Code: Select all

2022-11-17 04:00:00.165 Generating new Moon image
2022-11-17 05:00:00.512 Generating new Moon image
2022-11-17 06:00:00.296 Generating new Moon image
Enjoy,
Paul

Re: Display Moon Image with Span

Posted: Sat 19 Nov 2022 1:37 am
by grupe
Paul, I am not finding that info in MXDiags. CumulusMX is running on the same computer as my server, so I am copying, instead of using FTP. I'm not sure where to set up generating moon.png

Re: Display Moon Image with Span

Posted: Sat 19 Nov 2022 3:16 am
by grupe
I think I have it working now. I changed a bunch of settings. I will be updating and moving CulumusMX to a different pi computer. I will see what happens after that!

Re: Display Moon Image with Span

Posted: Sat 19 Nov 2022 3:20 am
by PaulMy
gnupe
I am not finding that info in MXDiags. CumulusMX is running on the same computer as my server, so I am copying, instead of using FTP. I'm not sure where to set up generating moon.png
Do you have similar Internet setting like my attached, but not FTP File?
That logs in my MXdiags every hour

Code: Select all

2022-11-18 22:00:00.088 Generating new Moon image

2022-11-18 22:00:01.586 LocalCopy: Copying Moon image file
2022-11-18 22:00:01.589 LocalCopy: Done copying Moon image file
2022-11-18 22:00:01.589 LocalCopy: Copy process complete
I have Debug logging and Data logging both enabled.

Enjoy,
Paul

Re: Display Moon Image with Span

Posted: Sat 19 Nov 2022 9:51 am
by SamiS
grupe wrote: Thu 17 Nov 2022 10:22 pm My moon image is not updating. I am lost as to what I must do. I am running the Cumulus MX Template by Neil Thomas 2022.
Have you checked that the moon image really is not updating on your website folder? I’m running the default website, and at least with ipad / safari there is a browser caching issue, that causes moon image to ”get stuck on the same image” and the correct moon phase is shown only maybe 4-6 times in a month. However by clearing cache or opening a private browsing window, the correct image is always shown.