Create custom block

Post Reply
User avatar
WessexWeather
Forecaster
Forecaster
Posts: 130
Joined: Mon Aug 21, 2017 6:26 pm
Location: Wimborne, East Dorset, UK
Station model: Davis Vantage Vue
Software: Meteobridge
Contact:

Create custom block

Post by WessexWeather » Sat Oct 07, 2017 8:18 am

Hi all,

I would like to create a block that simply displays my webcam time-lapse.

Webcams.travel create 24h, 30day and 13month time-lapse videos, and they provide the embed code to display these in one’s own website.

I presume I would use a Blank Block here, and paste in the html code somewhere?

Could anyone clarify how best to do this? And also, is it possible to have more than one blank block? If so how should I rename them so that everything works properly?

Thanks in advance.
Regards,

Simon (WessexWeather)

Image

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: Create custom block

Post by Jachym » Sat Oct 07, 2017 8:48 am

Hi,
yes copy the HTML in the Blank block. When creating new ones you need to rename both the folder to e.g. blank2 and the file blank2Block.php. Also note that you must be careful about Javascript, if you will use JS in the code, they might clash if you insert the same code twice in several blocks, so making copies of blocks with JS can result in non-functional homepage.

User avatar
BobW55
Forecaster
Forecaster
Posts: 115
Joined: Thu Sep 28, 2017 11:43 pm
Location: Michigan USA
Station model: Davis Pro2
Software: Cumulus
Contact:

Re: Create custom block

Post by BobW55 » Mon Oct 09, 2017 12:45 am

You can use the blocks already provided.
See here :http://www.melvinweather.com/template/indexDesktop.php
The Sky Eye image uses the WEBCAM block
And the 2 SKY EYE videos use the VIDEOS block.

I use a 3rd party software (IP TIME LAPSE) to capture the camera frames, and upload them to my server. It also creates the 2 time lapse videos and uploads those.
I just use the coding in the supplied blocks to point to the proper location (Directory) on my server.

Should you decide to create your own block:
1) Create a folder in the "BLOCK" folder (yourwebsite/template/homepage/blocks) with the name you would like to use example "webcam"
2)Now you should have a folder in the following path(yourwebsite/template/homepage/blocks/webcam)
3)Copy the 2 files from the blankBlock folder to your new folder (blankBlock.php and blankConfig.txt)
4) Rename the files to webcamBlock.php and webcamConfig.txt (VERY CASE SENSITIVE)
5) Edit the webcamBlock.php with what ever coding you need and save.
6) When you go to the block settings/add blocks from the Admin page, you should now see your newly created block.
http://melvinweather.com/template/indexDesktop.php
Davis Vantage Pro2 wired
Solar/UV sensors
Sky Cam
Ham radio K8pos

Post Reply