Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vojtěch Macháček 45 posts 198 karma points
    Aug 09, 2017 @ 07:50
    Vojtěch Macháček
    0

    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!

    contet types

  • David Brendel 786 posts 2949 karma points c-trib
    Aug 09, 2017 @ 08:31
    David Brendel
    1

    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

  • Vojtěch Macháček 45 posts 198 karma points
    Aug 09, 2017 @ 10:27
    Vojtěch Macháček
    0

    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..

  • David Brendel 786 posts 2949 karma points c-trib
    Aug 09, 2017 @ 10:36
    David Brendel
    0

    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

  • Vojtěch Macháček 45 posts 198 karma points
    Aug 09, 2017 @ 10:52
    Vojtěch Macháček
    0

    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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies