Page 1 of 1

Create / Edit Extra files

Posted: Mon 01 Jun 2020 12:23 pm
by stevendt
Hi,

can someone tell me the correct process (or point me to the right place to look) when adding editing extra web files please?

I have had limited success when trying to create & edit an extra file for Davis station status data.

I made a "proof of concept" page that just displayed the station type and am trying to expand on that.
When I created the page, I built the template and created the file in the \web folder.
(I am not very familiar with editing html, but I think I'm getting there)

Now that I have edited the page, uploading is doing weird things (well, it looks weird to me).

When a new file is created (on schedule, or by FTPNow!) the files is created as an htm with a tmp extension, i.e., name.htmtmp, rather than name.htm. During the FTP process, the file is transferred correctly, name.htmtmp --> name.htm on the website. But this is the only file that goes though that tmp phase, so there is surely something wrong.

It may be the process that I have used when editing (?).
Is there are correct procedure to go through when making changes?
Is putting the new nameT.htm and name.htm in the \web directory all that is needed, or is there something else?
Does CumuluxMX need to be stopped when making changes to the web pages? (I am not actually editing the file on the CumulusMX machine, just copying the new ones over)

regards
Dave

Re: Create / Edit Extra files

Posted: Mon 01 Jun 2020 1:13 pm
by water01
First of all it would be useful if we could see your site and the page in question as this would help us help you.

To get a new page processed by CumulusMX you need to create a template HTML file and call it xxxxxxxxT.htm. It looks lake a normal HTML page except not only will it have HTML commands it will have CumulusMX webtags (<#XXXXXXXXXX) as per the wiki page about webtags https://cumuluswiki.org/a/Webtags.

You then have to add it to as an additional file to the Extra Web Files area in MX. You must state the full local path Filename (i.e. D:\Program Files\CumulusMX\web\testT.htm ) the full Remote Filename from the point you have indicated in your Remote FTP Directory (i.e. public_html/CumulusMX/test.htm (note no T)) and then specify when and how you want it processed by ticking Process (this puts the data in the webtags), Reatime FTP (not usual to update webpages on the realtime interval), FTP (CumulusMX will FTP it after the file is processed), UTF-8 (this maintains pages as UTF-8 encoding usually wise to tick it as the standard pages use this encoding), Binary (if you want a forced binary FTP useful for such things as images and also I have found if you are using SFTP), and finally End of Day (i.e. only upload on the end of day rollover).

Don't worry about a file with tmp added to the extension this is what CumulusMX calls the file post Process but Pre FTP.

CumulusMX does not have to be stopped when adding, changing or working with web pages.

You should then have a working HTML page uploaded (hopefully with no errors in your code :D :D ).

Re: Create / Edit Extra files

Posted: Mon 01 Jun 2020 2:19 pm
by stevendt
Hi David,

thanks for the reply.

Well, the site is a "work in progress" (read bare!). I upload the standard CumulusMX pages and have just one, very basic page, with no links to it, to try messing with the status stuff. The home page is at www.primrosebank.net/weather/cumulus

the status page is at www.primrosebank.net/weather/cumulus/status.htm

There is nothing there but a few Davis Tags - it obviously needs some cosmetic surgery - if nothing else, to add time/date.

I think that I have gotten the template file thing sorted and how to add the extra file to the FTP section. I was not sure about the UTF-8 requirement and had it off, but I will turn it on anyway

Thanks for explaining the htmtmp thing. I am surprised that it is not transient though, should it not get deleted after a successful upload?

So, just so that I am 100% clear, I should never need to create or upload the .htm file, only create (and not upload) the ??T.htm template (and add the .htm source and destination) to the extra files list and Cumulus does the rest?

"You should then have a working HTML page uploaded (hopefully with no errors in your code )."
The chances of that are VERY remote - I'm VERY unfamiliar with editing html directly :?

regards
Dave

Re: Create / Edit Extra files

Posted: Mon 01 Jun 2020 6:46 pm
by freddie
Your page looks fine to me - basic, as you said, but completely functional.

Re: Create / Edit Extra files

Posted: Mon 01 Jun 2020 7:30 pm
by sfws
Your page is taking shape, don't knock your initial efforts. Also don't be fearful of editing HTML, you can't break your computer, the worse that will happen is the page layout is messed up, browsers are pretty tolerant of mistakes!
Most browsers allow you to "Display source" and in that view any HTML errors are shown in bright red.

There are also places where you submit the URL of your web page and all your HTML is checked against the standard, but that is a bit advanced for you at this stage.

However, I suggest you replace

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="en-gb" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Station Status</title>
</head>
with HTML that meets the current HTML5 standard
For example

Code: Select all

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="Primrosebank weather data" />
<meta name="keywords" content="Cumulus, Primrosebank weather data, weather, data, weather station" />
<title>Primrosebank weather - Station Status</title>
<link href="weatherstyle.css" rel="stylesheet" type="text/css" />
</head>
and I am sure you can work out where I took that from on your web site (all I edited was the title)!

You will find as well as conforming to modern standards, that instantly gives your page styling consistent with your other pages, and so makes it seem as if all the pages are a coherent whole.

Keep going, you will get there.

Re: Create / Edit Extra files

Posted: Mon 01 Jun 2020 9:01 pm
by stevendt
Hi,

Thanks a lot for the info. Yes, I know that I won’t break my computer, well, apart from when I give it a good thump when it’s not doing what I expect (even when it IS doing what I told it to) :D

I have built quite a few web pages in the past, but so far, the lazy way - using a web editor tool. Initially FrontPage, until Microsoft killed it. Then Microsoft’s short lived replacement, Web Expression. It’s dead now too, but was free. That’s where the code at the top of my page originated - from the “blank” page template in Web Exoression 4. Obviously, it’s quite old now and not HTML5 aware. Yes, definitely “a bit advanced” for me, but there by default. Up until now, I have tried to avoid getting deep into HTML, but I guess that Ineed to start.

Thanks a lot for the header edit, having it look the same as the other Cumulus pages would be great, I will give it a go in the morning,

Regards
Dave

Re: Create / Edit Extra files

Posted: Mon 01 Jun 2020 10:55 pm
by water01
So, just so that I am 100% clear, I should never need to create or upload the .htm file, only create (and not upload) the ??T.htm template (and add the .htm source and destination) to the extra files list and Cumulus does the rest?
Yes that is quite correct.

If you follow sfws's suggestion that will also allow you to add other features such as the general styling of a CumulusMX website.

I also in the early days (many,many years ago) of writing html I usually took a standard web page as a template. By this I mean for instance taking the standard indexT.htm and copying it to templateT.htm and then stripping out all the code I didn't want in my standard template from that file (it could be as drastic as everything between the opening and closing body statements) and then cutting and pasting bits back in that I might want to retain for every page (like the menu system) and altering other bits and when I am finally ready copying the file to mynewcodeT.htm and getting CumulusMX to process and upload that. That way you always have a good start point to build a new page.

If you have a good Webpage editor (I personally use WeBuilder (https://www.webuilderapp.com/) not free but a very good investment)) you can trial web pages in situ on your computer before adding the upload which also shortens the development process.

Good luck and happy page building.

Re: Create / Edit Extra files

Posted: Tue 02 Jun 2020 4:35 am
by sfws
water01 wrote: Mon 01 Jun 2020 10:55 pm If you have a good Webpage editor (I personally use WeBuilder (https://www.webuilderapp.com/) not free but a very good investment)) you can trial web pages in situ on your computer before adding the upload which also shortens the development process.
Brackets is a web page editor that is free and the Live Preview feature in it is presumably similar to the feature in WeBuilder that water01 mentions, although I don't know latter. Brackets is designed for a "web project". Since you have experience of obsolete web tools, you might like that. I tried it, but found the setting up a bit daunting! Also I make lots of errors when typing, and undoing is not as simple in Brackets as in some other editors. But Brackets is recommended by others for beginners because it is a sophisticated editor with multiple windows to help you link HTML, CSS and JavaScript, plus other developer features.

Just so nobody objects to me picking particular editors to name, other editors are available for those trying to code! I have tried a lot of different ones since using Cumulus started me on this coding lark, all have been free, all have some good features and all have some slightly annoying issues. One feature I like is the ability to do a global edit, when I have found something I am pleased with, or something I want to change, I like to edit all my web pages in one action.

I prefer to slow myself down, and I currently use the much simpler editor Notepad++ also free. The big attraction is the versioning feature (it stores backups that are stamped with date and time). That way, if something does not work, it is easy to go back one, two or more versions and then start again from there! Believe me, I do that a lot. It also has a number of other useful features, but its drawback for me is not holding a basic structure that you can build a new web page from (unlike most of the other editors I have tried).

None of the editing software produced by others, seems to have the particular mix of features that I like.

Re: Create / Edit Extra files

Posted: Tue 02 Jun 2020 12:13 pm
by stevendt
Hi Guys,

thanks for the pointers. I am going to stick with Expression Web at the moment since it's free, just about does the job, and, most importantly, I do at least have a little familiarity with it.

I have made the change suggested by sfws to include the Cumulus Style sheet and got the basic page to look much better. I have now copied and edited a lot of the code from the index template to get the data in tabular form. (I have screwed something up though, as the table size has been lost and now fills the whole screen width, but I am looking at that.)

regards
Dave

Re: Create / Edit Extra files

Posted: Tue 02 Jun 2020 2:06 pm
by beteljuice
(I have screwed something up though, as the table size has been lost and now fills the whole screen width, but I am looking at that.)
Simple error ...
Your header and table are before the content <div> and not inside it ;)

Re: Create / Edit Extra files

Posted: Tue 02 Jun 2020 2:50 pm
by stevendt
"Simple error ..." Easy for you to say :)

Thanks a lot for spotting that - it would have taken me forever!

Just when I start to think I'm getting the hang of it . . . :cry:

regards
Dave

Re: Create / Edit Extra files

Posted: Tue 02 Jun 2020 5:20 pm
by sfws
I have read many books about HTML (and the other things I have learnt about during my retirement).

Obviously a lot of that reading was several years ago now, but one message is preached by every book as far as I recall, build from outside in.

In other words if you add a <div> </div> pair, then your next insert is within those tags. That way you always first add pairs of tags, and then add something between them. That is supposed to make sure you don't make your mistake of adding outside ('content' in your case). A lot of the software available for editing code also follows this approach, I believe it is called "folding". I don't know if your Expression Web does it this way.

By the way just to muddle you more, div is old hat.

HTML5 encourages you to use more meaningful groupings (unfortunately it is made a little complicated because there are some restrictions on which ones you can use inside one of the others, I suspect that is partly why people stick to div, if all are same, then order is irrelevant.
<main> to </main> Used to delimit the part of a web page you want everyone to read, only allowed to be used once per page
<section> to </section> As name suggests this is intended to split different parts of the output, generally can be used wherever div worked
<article> to <article> As name suggests this is supposed to delimit parts of a web page that can safely be read in isolation, you don't need to read other articles to understand any one article
<header> to </header> As name suggests this is used at start of output on a web page, but as it can be used any number of times, the HTML5 standard expects you to use it at start within section and article as well
<footer> to </footer> As header, but at end of web page, end of section or end of article.

That is all I can remember by quizzing my memory.

If this puzzles you, have a look at the replacement now page for the admin interface I posted at viewtopic.php?f=28&t=17911 I left some <div> to </div> where they appeared close to each other, but I changed all the ones where there was a lot of content in-between. Look at that page and compare it against Steve Loft's original (as far as I know Mark has only made minor changes) that is included within each MX release, I am sure you will agree that mine is very much easier to read.

Re: Create / Edit Extra files

Posted: Tue 02 Jun 2020 5:36 pm
by stevendt
HI,

thanks for that.

I guess a big part of the problem is my trying to cut a few corners and adapt what have been done before, rather than writing new HTML from scratch. Probably the <div> error was made when I tried to cut & paste from the Cumulus standard index page into my new one. I can't recall now, but it is likely that I pasted in the Expression Web Design window, rather than the Code window and pasted in the wrong place. I would have had a better change of spotting the <div> issue had I been looking in the right place.

I just tried entering a new <div>tag in the Expression Web code windows and it does automatically put a closing </div? next to it to help with that pairing concept.

As I say, the "old hat" <div> tags came from the default Cumulus page.

Yes, your code does look more readable - but still all Greek to me at the moment :)

regards
Dave

Re: Create / Edit Extra files

Posted: Tue 02 Jun 2020 11:24 pm
by beteljuice
div is old hat. - the beteljuice likes old hats :?

HTML5 ... It's all Geek to me :ugeek: