Load vimeo video beneath text input for (pre)view
#1
Posted 02 August 2012 - 09:22 AM
Been getting into Processwire for the past couple of days, it’s simply amazing, very nice work there (Ryan)! I’ve got a short question; I’m trying to make a field where you can input a vimeo url or vimeo video id (just as a text input), and have it load the video beneath the text field when the field loses focus. This is something that can easily be done with some javascript, but I’m wondering if I should make a custom field (module?) for this, or what the best approach would be to get this in the existing ProcessWire structure?
I know that there is a module that converts urls to embed codes and displays them in a (tinymce) field, but I’d rather separate display and input here. I appreciate any insights, and thank you in advance for reading / thinking along!
Best regards,
Thijs
#4
Posted 02 August 2012 - 11:30 AM
edit: Have a look at http://modules.proce...e-color-picker/ as an example of a field type module that includes some js and css on the admin.
#5
Posted 02 August 2012 - 11:39 AM
Edit: of course nothing again creating a simple fieldtype/inputfield module that would be more flexible and dedicated, but little more complex.
@somartist | modules created | support me, flattr my work flattr.com
#6
Posted 02 August 2012 - 12:17 PM
#7
Posted 02 August 2012 - 12:31 PM
@somartist | modules created | support me, flattr my work flattr.com
#8
Posted 02 August 2012 - 12:37 PM
#9
Posted 02 August 2012 - 01:03 PM
#11
Posted 19 August 2012 - 02:44 PM
#12
Posted 20 August 2012 - 07:36 AM
$page->images->add("http://domain.com/path/to/file.jpg");Or if it's a single image and output formatting on:
$page->image = "http://domain.com/path/to/file.jpg";
The first example is more likely the one you'd want. When you save, it should download the image and put it into the system.
#13
Posted 20 August 2012 - 08:01 AM
#14
Posted 20 August 2012 - 08:26 AM
@somartist | modules created | support me, flattr my work flattr.com
#16
Posted 20 August 2012 - 08:41 AM
#17
Posted 20 August 2012 - 03:07 PM
#18
Posted 21 August 2012 - 02:16 AM
#19
Posted 21 August 2012 - 07:03 AM
The fieldtype should consist out of a text field entry field for the video url, another text field where the retrieved embed code is stored, and an image field where the thumbnail belonging to the fetched video will be stored, and also some optional config fields (i.e. to specify a fixed width for the video, or any other presets such as autoplay).
You might want to look at using a repeater for this, as it would enable you to do this pretty easily. Though cloning and modifying the existing images fieldtype would enable you to do all this too (with a little more work).
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













