Skip Navigation

[Resolved] Self hosted video file – Post Form

This support ticket is created 4 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 9 replies, has 2 voices.

Last updated by Luo Yang 4 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1375925

Hello and sorry,
I'm trying to reopen this already closed ticket: https://toolset.com/forums/topic/self-hosted-video-file-post-form/

I just need one more thing, as it is written in my last question:

"OK, I got it, so now I need to know how to use PHP from Joomla CCK Seblod

<div id="videobox">
<?php if ($cck->getValue('video')) { ?><video id="<?php echo $cck->get("video")->value; ?>" class="video-js vjs-default-skin vjs-static-controls" controls preload="none" width="600" height="338" poster="templates/tutorials/images/video/<?php echo $cck->get("video")->value; ?>.jpg" data-setup="{}">
<source src="templates/tutorials/images/video/<?php echo $cck->get("video")->value; ?>.mp4" type='video/mp4' />
</video><?php }?>

to be compatible with Toolset?

I mean how to call Toolset custom field "video" in this example."

Thank you again for your help and understanding.

Jiri

#1376121

Dear Jiri,

Those PHP codes are for Joomla, since Joomla and WordPress are different systems, so those codes won't work as expected in WordPress.

In your case, you can consider these:
1) Create a custom post type "Video"
https://toolset.com/documentation/user-guides/create-a-custom-post-type/

2) Create two post fields:
- a custom video field, stores the video file URL
- a custom image field, stores the image file URL
https://toolset.com/documentation/user-guides/using-custom-fields/

3) Setup a content template for single "Video" post, display the HTML codes with Types shortcode according to VideoJS document:
hidden link

More help:
https://toolset.com/documentation/user-guides/view-templates/

#1378381

Dear Luo Yang,

of course, I understand that Joomla is a different system than WordPress.

Previously I already made Post Type "Video" and also two fields "video" and "image". And in Joomla, I was also using the same VideoJS system/code for displaying videos, so there is no need to change it.

The only thing what I need is how to "call" these fields properly in Toolset/Wordpress – I mean how to change this code with CCK Seblod fields:

<?php if ($cck->getValue('video')) { ?><video id="<?php echo $cck->get("video")->value; ?> to Toolset's way.

I hope that now it is clear.
Many thanks, best,

Jiri

#1378539

I assume we are talking about two custom fields "video" and "image" created with Types plugin, in Toolset way, you can use Types/Views shortcode to setup the video HTML codes.

1) Use shortcode [wpv-conditional] to check if "video" field isn't empty, then output the video HTML codes, see our document:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/

2) For the video's ID attribute, you can use current "Video" post ID as the unique ID, see our document:
hidden link

For example:

[wpv-conditional if="( $(wpcf-video) ne '' )"]
<video id="[wpv-post-id]" ...>
...
</video>
[/wpv-conditional]
#1379465

OK, now I understand the Toolset way of implementing custom fields,
but there is maybe some complication...

As you can see here in the code from the previous Joomla version... I need to put/insert custom field value into the name of the source file:

<div id="videobox">
<?php if ($cck->getValue('video')) { ?><video id="<?php echo $cck->get("video")->value; ?>" class="video-js vjs-default-skin vjs-static-controls" controls preload="none" width="600" height="338" poster="templates/tutorials/images/video/<?php echo $cck->get("video")->value; ?>.jpg" data-setup="{}">
<source src="templates/tutorials/images/video/<?php echo $cck->get("video")->value; ?>.mp4" type='video/mp4' />
</video><?php }?>

<br>

<?php if ($cck->getValue('video')) { ?><a href="templates/tutorials/images/video/download.php?file=<?php echo $cck->get("video")->value; ?>.mp4" class="casting">Video download</a><?php }?>
</div>

The reason why I'm doing it in this way is that the video file (.mp4) and also the video thumbnail (.jpg) are uploaded on the FTP server separately (not by Toolset Post Form). Through the Post Form, I'm going to fill the name of the content and also upload some other image (.jpg).

So for example, how I'm doing to insert Toolset field value here?

<?php if ($cck->getValue('video')) { ?><a href="templates/tutorials/images/video/download.php?file=<?php echo $cck->get("video")->value; ?>.mp4" class="casting">Video download</a><?php }?>

Is this the way of doing it correctly?

[wpv-conditional if="( $(wpcf-video) ne '' )"]<a href="templates/tutorials/images/video/download.php?file=[types field='video'][/types].mp4" class="casting">Video download</a>[/wpv-conditional]

Many thanks for your patience and help.
Best,
Jiri.

#1379569

It depends on how you setup the custom field "video" and field value in it, for example, if it is a custom video field "video", and you are are using below field value:
hidden link

Then you can output the video raw URL like this:

[types field='video' output='raw'][/types]

Use it like this:

[wpv-conditional if="( $(wpcf-video) ne '' )"]
<a href="templates/tutorials/images/video/download.php?file=[types field='video' output='raw'][/types]" class="casting">Video download</a>
[/wpv-conditional]
#1379589

OK, I will try it and then let you know.
Thank you!
Jiri

#1379701

OK, please update here if you need more assistance for it, thanks

#1382799

OK, next week I will have a time to solve this issue.
Thanks!

#1382967

I have marked this thread as "Waiting for feedback", you can update here when you need more assistance.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.