Forum

Thread tagged as: Question, Configuration

Content Tag for Adding Video

I couldn't find an answer to this in the docs. I need to provide the editors with a way to upload embedded video as well as images. I tried using a perch tag to insert the video path into the markup, but the control panel provided no way for them to upload the video to the perch resources folder. The type="image" tag presents an upload field automatically. Is there a type="video" tag? Can they do this using the type="image" template (does perch insert the required html markup for video)?

Presently, I've built a template that has a text field to enter the video path manually and no file upload function. I think that is too much to ask of the editors.

I'm looking for a way to a) provide them with a file upload menu, and b) write the file path into the html automatically.

What is the best way to do this?

~~~ ~~~

kyle cadotte

kyle cadotte 0 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Kyle,

I think you can use the file field type for this: https://docs.grabaperch.com/templates/field-types/file/

does perch insert the required html markup for video

You have control over your markup. A simple example:

<video controls>
  <source src="<perch:content id="video" type="file" label="Video">" type="video/mp4">
</video>

Aha, so use the general type="file" for this. I'm also adding also a type="image" tag for the poster image.

Thank you.