Copied to clipboard

Flag this post as spam?

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


  • eneunaber 10 posts 64 karma points
    Jun 23, 2009 @ 06:10
    eneunaber
    1

    How to use Media

    Being new to Umbraco, it is unclear to me as to how or when to use "Media" type?

    I quickly created a new Doc type and template and tied them together with a CSS file.

    However, I have images that I want to include in my site. Do I upload those to the "Media" folder or what do I do with them?

    Thanks,

    Eric

  • Paul Blair 466 posts 731 karma points
    Jun 23, 2009 @ 06:52
    Paul Blair
    101

    Hi Eric,

    You would generally use the media section for images and documents that you want the site editors to maintain and change themselves. e.g photos that are part of a photo gallery.

    For images that are part of your actual design I would put them in a seperate images directory (there is no images directory by default in a new Umbraco solution so you will need to create it) and refer to them directly in the CSS and template files.

    Cheers

    Paul

  • Bert 128 posts 251 karma points
    Jun 23, 2009 @ 10:18
    Bert
    101

    Will an image be changed by editors? --> Media

    Want a random image? --> Media

    Do you add the media once and nobody but the developer(s) should touch it? --> A seperate image folder.

    All layout related images --> Image folder

     

    That's how I do it at least :)

     

  • eneunaber 10 posts 64 karma points
    Jun 23, 2009 @ 15:55
    eneunaber
    0

    Guys, that was exactly what I was looking for. Thank you for the reply!

  • eneunaber 10 posts 64 karma points
    Jun 23, 2009 @ 15:59
    eneunaber
    0

    Wait, now I realized I had another question. You mean to add a folder under the Web Site and not under "Developer" or "Settings", correct?  

    If that is the case, do I have to create a new document type that is "folder" because I can't seem to simply add a folder when I right click on my site?

  • Bert 128 posts 251 karma points
    Jun 24, 2009 @ 12:38
    Bert
    0

    We actually mean to add the files for the layout in a folder on the file system. Nothing to do with the umbraco back office. So in the Umbraco folder on your file system add a 'Images' or 'Layout'. or any name you prefer somewhere in that folder. I use  /Umbraco/Images.

  • Fredrik Esseen 610 posts 906 karma points
    Jun 24, 2009 @ 12:57
    Fredrik Esseen
    0

    Just a little thought now when were talking about where to access and put our images. Umbraco can automatically create thumbnails and different sizes of an image when I upload it. I have a number of customers who wants to use these images in the editor. Why am I not allowed to use these? or is there some clever way to achieve this?

  • kmacdonell 28 posts 45 karma points
    Jun 24, 2009 @ 16:09
    kmacdonell
    0

    ImageGen will solve your prolem froad:

    http://www.percipientstudios.com/

    http://www.percipientstudios.com/media/5549/imagegen%202.0.1%20documentation.pdf

    It's a compnent that will re-create images on-the-fly from the original image. It does lots of other clever stuff and has great caching capabilities as well but in the simplest use it can easily create various sizes of an image.

    <img src="/umbraco/ImageGen.ashx?image=/media/watch.jpg&width=200" />

    To get the specific path to an image, brose to it in the media section, click on the thumbnail and copy the address from the address bar.

    If you want to resize an image that the user has picked as a node you can use something like:

    <xsl:element name="img">

  • Fredrik Esseen 610 posts 906 karma points
    Jun 24, 2009 @ 16:29
    Fredrik Esseen
    0

    ImageGen is not the solution to the problem. The users wants to be able to choose the different versions of the image from the TinyMce editor (Insert Image Popup). I know that ImageGen automatically changes the image to the right weight when the user changes the size by dragging the image but that is not good enough. It might seem "picky" of me/user but since I have heard this from several customers I feel that I have to mention it here.

  • kmacdonell 28 posts 45 karma points
    Jun 24, 2009 @ 17:24
    kmacdonell
    0

    Hi Froad,

    Under what circumstances would a user be choosing an image to insert into TinyMCE? Would it be possible to control the approach so that the images were inserted through a media picker and only the text was editited in TinyMCE?

    Alternatively, you could write some XSLT to scan the contents of the TinyMCE editor, find the image and replace the source with the imagegen script path. This would ensure that the image that was output on the site was a properly resized image instead of a stretched one.

    Cheers,
    Kev

  • Fredrik Esseen 610 posts 906 karma points
    Jun 25, 2009 @ 08:26
    Fredrik Esseen
    0

    That is one approach but then the Html editor looses a lot of its functionality. If a user shouldnt be able to insert an image through the "Insert Image"-button in the editor then theres no possibility to let text wrap around images and have a dynamic amount of images inside an article. Or am I wrong?

    I could have a field where the user puts his image and use a mediapicker to get the size that I want, and probably that is the best way, but not what my customers are trying to achieve.

  • Markus Bratlie 1 post 21 karma points
    Oct 17, 2011 @ 16:54
    Markus Bratlie
    0

    Im making a slider, here i have 5 pics that i put in Folder inside Media.

    Inside the folder i made 5 files and uploaded each pic that wanted to use in the slider, then Im linking it to the template with:

    <img src="url to the image, in one case fexample media/1272/slide01.jpg" />

    If im then updating one of the files with another picture will not the img src be the same.

    Then, here is my quistion.

    Is it any way I can write something like this <img src="media/folder/name" /> ???

    And then it is updating automatic, and i dont have to change the last text slide01.jpg     (media/1272/slide01.jpg" /) to the picture im updating it with.

     

Please Sign in or register to post replies

Write your reply to:

Draft