Hello everyone, I would like to create my own Content type, it would be youtube video which wold render itself differently on AMP page and on normal page. Can anyone please point to right direction? Thanks!
Hello Daniel, thanks for your reply, I saw that one, it won't work because the image there is using fixed width and height and that's not realistic for production environment. And currently the media object isn't exposing width and height, which I want to fix also. Thus I want to create my own content type from scratch..
don't think that is possible at all. There are Media, Folder and File. Nothing you can create like CustomMedia.
I think AMP images are always the same size as they should fit for mobile devices. For images resizing have a look at ImageProcessor which comes with Umbraco. With that, you can resize images on the fly by query parameters. Of course cached so images won't get recreated on every page hit.
There is option in backoffice to create new Media Type, so I guess its not a problem. What I don't understand is the plumbing from the MediaType to the Grid and than to the Razor. If I just could add width and height to the current media being serialized to the media view, that would do it.
I'm using AMP images like this (in carousel)
Blue water Express Bali fast boat I would like to maintain the aspect ratio of the images. Now I need to add them to the Grid Content. And the youtube is also different story.
Creating new Content Type
Hello everyone, I would like to create my own Content type, it would be youtube video which wold render itself differently on AMP page and on normal page. Can anyone please point to right direction? Thanks!
Hi,
have a look at this blog post. There is an example on how to create a custom grid editor that is ready for AMP:
https://carolelogan.net/blog/amp-implementation-in-umbraco/
Regards David
Hello Daniel, thanks for your reply, I saw that one, it won't work because the image there is using fixed width and height and that's not realistic for production environment. And currently the media object isn't exposing width and height, which I want to fix also. Thus I want to create my own content type from scratch..
Hi,
don't think that is possible at all. There are Media, Folder and File. Nothing you can create like CustomMedia.
I think AMP images are always the same size as they should fit for mobile devices. For images resizing have a look at ImageProcessor which comes with Umbraco. With that, you can resize images on the fly by query parameters. Of course cached so images won't get recreated on every page hit.
Maybe I misunderstand what you really need?
Regards David
There is option in backoffice to create new Media Type, so I guess its not a problem. What I don't understand is the plumbing from the MediaType to the Grid and than to the Razor. If I just could add width and height to the current media being serialized to the media view, that would do it.
I'm using AMP images like this (in carousel) Blue water Express Bali fast boat I would like to maintain the aspect ratio of the images. Now I need to add them to the Grid Content. And the youtube is also different story.
is working on a reply...