Hi, I created a collection with several custom fields like Name, image and YT video link.
I would like to show cards with an image, a heading overlay and when clicked, the YT video would be popping up. But it looks like I cannot add my custom video link field to the Youtube element. Am I missing something? Can’t we add videos to collections?
Hi @Jean_Pierre_Michael
you can use the CMS field type and add a YouTube element into it. This CMS field type then can be assigned to a regular container element. This way you’re also more flexible if you need a replacement in case there is no video available for an item.
hi @AndyG , You lost me. I can add a CMS custom field. I called it Youtube link. but how do you add a youtube element to it? you mean the YT link? And then on the collection, you add a container and how do you populate it with This CMS field? I’m sorry but this is not clear to me…
let’s talk in pictures:
[1] Create a CMS type field (in my example I simply called it Video
)
[2] Go to the items manager, edit an item and at the Video
field, click “Edit in CMS”
[3] It opens a new tab with empty content. Add any element(s), e.g. a YouTube element
[4] Now go back to your collection container, add a container element inside and assign it to the Video
field
Does that help you?
I understood now ! thanks for the help. I’m gonna dive to it
Ok, I did what you said, But now How can I populate this video element with the links I imported ? I have 133 links assigned to this CMS field but I just see the links, not the video.
This is something I am trying to accomplish as well. Rebuilding a site for a client and they have a lot of video links to load. hoping this doesn’t affect page load as it did in their current configuration on another application
Hi! Here is a video with the steps to add a YouTube video in the Collection as explained by @AndyG .
After you create the CMS field and add all your videos, to create a collection listing:
- Add a Collection Container Element (make sure to assign your collection to this)
- Inside one of the places in the loop add a simple Container Element
- Assign the content of the Container Element to be your YT CMS field. Done
Here is the video: SiteJet YT - Collection List/Item · CleanShot Cloud
Thanks a lot @Lucian_Dinu , but how do you use your YT link already imported or to what element do you assign them to show on the front end. I see you manually add it to an item. Is there a way to import lots of csv YT links that were part of wp posts and assign them to the YT container ?
Hi! There is no way to dynamically bind a collection field value to an attribute (at least I don’t see a way). In this approach you will have to manually add inside the CMS field a YouTube Element and add there the video source (manually).
Oh, i thought the collections were dynamic. You can query anything (title etc…) but cannot populate a field element? That’s strange. Feature request? I have more than 300 videos to link. Ready for Christmas…
I better be sure before using sitejet for this project then.
Hi! Yes… there are some limits.
Right now, the dinamic data implementation in SiteJet is quite basic.
Fields in general cannot be assigned (bind) to other elements or attributes.
In general collection fields can be assigned only to the content of: Headline element, Text element (on this element we can’t bind the link also), Image element, Audio, Video, Container element (CMS field)
Ok, thank you @Lucian_Dinu so that shouldn’t be a problem adding the link import to the YT link field?
@Andre @AndyG
Is it @AndyG ?
@Jean_Pierre_Michael As of now, you can’t assign a link to a YouTube element. That’s why I suggested above to create a CMS type field instead and add a YouTube element into it. Instead of assigning the link to a YouTube element, you would assign the Video
field to a container. This way you can achieve what you’re about to do.
Yes i get it. My concern was about the importation of a csv file with YT links that I would like to populate those YT player
Having the same issue with image links. Trying to import multiple (hundreds) of image links into an image element through the data collection. This should be achievable but I think there might have to be a little tweaking on the data collection so that it dynamically populates the links into the element type. Should be identical for video link or image link.
@Jean_Pierre_Michael You could alter your CSV so instead of YT links you’re actually importing embed codes. These could be imported into a Rich Text field and assigned to a text element.
Let’s do this from scratch in a minimum example (topic: Sitejet Reviews):
-
Set up a new collection called
Reviews
-
Add a field
Video
, type Rich Text, so the setup looks like this
-
Prepare a CSV file that contains YouTube embed codes (you only need to generate one and from there you could simply replace the YouTube video ID, so you can automate it in Excel). Mine looked like this
-
Go to Manage items → Import CSV, drop the CSV, do the mapping and hit Import
-
Now add a new collection container, assign it to the
Reviews
collection -
Inside add a Text element (yes, a Text element) and assign it to the
Video
field
You can import Sitejet image URLs to File fields, which can be assigned to image elements.
If the image URLs are hosted elsewhere, you could follow a similar approach as I described here, but with <img src="...">
instead of YouTube embed codes.
Great idea @malte ! not the easiest but it can be done.
my ultimate goal is this. I have films with poster cover and a video link. Some only have the poster. So we should see the cover poster of each film and when clicking on it, a lightbox would open with either the video (if there is a link, or the poster cover.
Not that easy I can imagine.
Do you think it’s possible ?