Copied to clipboard

Flag this post as spam?

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


  • Jason Denousse 24 posts 93 karma points
    May 23, 2019 @ 10:39
    Jason Denousse
    0

    Best way to insert an image

    All i want is to be able to choose an image from the media library and place it into a specific div within my html.

    I have tried the media picker, however, that doesnt work. The out put is

    I have also tried the RTE and just select an image. Although it does upload the image, it places a p tag for some reason which i do not want.

    What is the easiest and simplest way to upload images from the media section into a div.

  • andy 25 posts 94 karma points c-trib
    May 29, 2019 @ 10:51
    andy
    0

    Hi Jason,

    Can you pasted a snippet showing how you were attempting to output the image in your div?

    The Umbraco docs detail a couple of Razor snippets that you may find helpful: https://our.umbraco.com/documentation/Reference/Querying/UmbracoHelper/#working-with-media

  • Magnus Eriksson 122 posts 362 karma points
    May 29, 2019 @ 11:31
    Magnus Eriksson
    0

    If you need an image inside a div in the RTE the easiest way would probably be a macro: https://our.umbraco.com/documentation/Reference/Templating/Macros/

    If you have a mediapicker property on your document type and using strongly typed models in your templates you would get a Umbraco.Web.PublishedModels.Image from the model of the document type.

    Regards, Magnus

  • 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