Copied to clipboard

Flag this post as spam?

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


  • Adam Riggs 1 post 71 karma points
    May 10, 2019 @ 10:22
    Adam Riggs
    0

    URL uploads

    hey guys

    extremely new and have not got much experience.

    Basically i am using umbraco for our bar/restaurant website. we have tabs for certain things like food drink location etc and i am "trying" to upload menus that are saved as a PDF. its only uploading as a url link and people need to click on that link to open the menu but i would prefer it to just be a picture of the menu as appose to a link?

    can any help?

    thanks Adam

  • Steven Lemmens 4 posts 78 karma points
    May 10, 2019 @ 20:29
    Steven Lemmens
    0

    Hey!

    Little experience here as well, but maybe this helps.

    Maybe you can convert your PDF to an image first, by (for instance) taking a screenshot of it and then using a Media Picker editor on your page to select the image.

    You can then display the image on your website like this:

    @{
       var img =  Model.Value<IPublishedContent>("propertyHandle");
                            }
                            <img src="@img.Url" alt="@img.Name" />
    

    (replace "propertyHandle" with the right handle from the property that has the media picker)

    And if you would like to give them a link to the full PDF, maybe put an tag around the img, like this: (you'll need an extra property on your page which links to your PDF file. You can use a media picker for this as well I think)

     <a href="link/to/file.pdf" target="_blank"><img src="@img.Url" alt="@img.Name" /></a>
    

    Does this help?

  • 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