Hi
I can’t echo the url of my video file correctly from a simple select field. (I’m using the fieldtoggle plugin but I don’t think this doesn’t change anything.)
<?php foreach($page->children()->visible() as $project): ?>
<?php if($project->type() == "videos"): ?>
<?php $video = $project->video()->toFile();?>
<?php echo $video->url() ?>
The URL is echoing without subfolders, I just get the root of the project like http://myswebsite.com/
The blueprint is pretty simple :
type:
label: Projet images ou vidéo
type: fieldtoggle
options:
images: "Images"
videos: "Vidéos"
show:
videos: vignette video
hide:
images: vignette video
vignette:
label: vidéo vignette (MP4)
type: select
options: videos
width: 1/2
video:
label: vidéo vignette (MP4)
type: select
options: videos
width: 1/2
When I dump the $project
I get
[fields] => Array
(
[prevnext] =>
[title] => Test
[client] => Client
[annee] => 2018
[mode] => true
[type] => videos
[vignette] => vignette_air.mp4
[video] => vignette_air.mp4
)