Page 1 of 1

Create custom block

Posted: Sat Oct 07, 2017 8:18 am
by WessexWeather
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.

Re: Create custom block

Posted: Sat Oct 07, 2017 8:48 am
by Jachym
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.

Re: Create custom block

Posted: Mon Oct 09, 2017 12:45 am
by BobW55
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.