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
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/
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
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]
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')) { ?>get("video")->value; ?>.mp4" class="casting">Video download<?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')) { ?>get("video")->value; ?>.mp4" class="casting">Video download<?php }?>
Is this the way of doing it correctly?
[wpv-conditional if="( $(wpcf-video) ne '' )"]Video download[/wpv-conditional]
Many thanks for your patience and help.
Best,
Jiri.
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]
OK, I will try it and then let you know.
Thank you!
Jiri
OK, please update here if you need more assistance for it, thanks
OK, next week I will have a time to solve this issue.
Thanks!
I have marked this thread as "Waiting for feedback", you can update here when you need more assistance.