I have created a custom persistent tile which I would like to use to upload/display video from. I am not concerned with transcoding the video I just need to be able to upload it in the tile setting page and be able to reference it in the template.
The only way I can see for
NamedBlobImage to produce a url is to use plone scales which creates a url via the
I see from other topics that the preferred way to do this is to add the content via a richtext file, however I want a custom template for the tile, which references the embedded video. So for the purposes of this use case a richtext tile is not an option.
My custom persistent tile is created like this:
some_image = NamedBlobImage(
some_video = NamedBlobFile(
And my view is:
template = ViewPageTemplateFile('templates/my_tile.pt')
In my template I can use
@@images to get a url for the image:
<img tal:define="scales view/@@images;
image python: scales.scale('some_image', width=1920, height=600, direction='down');"
height image/height;" />
I can't see how I would get to the image directly without using plone scales.
Is there an alternative solution to achieve what I am trying to do?
Some options I had though of were:
- Uploading the image to the site as its own content object and using a relation field to select it in the tile
- Seeing if it is possible to pass the video through plone.scales without altering it (probably not possible/advisable)
- Creating a new view for my tile which can return the data which can be referenced in the template.