Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Feb 19, 2010 @ 11:04
    Ismail Mayat
    0

    Full url issue with insert image

    Guys,

    I am using 4.0.1 and having the following issue.  If I insert an image in rich text editor and paste url into url field instead of picking image locally stored in media section eg http://l.yimg.com/i/i/uk/metro/steth.jpg then publish page all works fine my image tag has full url.  

    Now if my website is www.mysite.com and in my media folder I have image, before inserting image in rich text editor I goto media section find image I am interested in then click on image, this opens in new window I then copy the full url eg http://www.mysite.com/media/12345/someimage.jpg I then in rich text editor insert image again but this time paste full url.  I then save and publish.  The src for my image tag becomes /media/12345/someimage.jpg and not the expected http://www.mysite.com/media/12345/someimage.jpg.  Looks like umbraco is stripping full url.

    The reason why I am inserting images in this way is that I have created a newsletter template, my site users can create newsletters save and publish then view the page and copy the html of the page and paste it into their preferred newsletter mailer.  So any image paths need to be full not relative else images in email client will not appear.  Is there a way of stopping the full url from being stripped from the image?

    Thanks

     

    Ismail

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Feb 19, 2010 @ 11:10
    Peter Gregory
    0

    Have you tried setting the useDomainPrefixes option in the umbracoSettings.config?   This will ensure that the domain is appended.

    Not sure if it works for media though?

    Peter

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Feb 19, 2010 @ 11:10
    Morten Bock
    1

    I have seen this with links as well. Umbraco does strip the domain part if it matches the current domain you are working in, and I have not been able to find a setting that disables this.

    The way I fixed it was by RegEx'ing the output, and reinserting the domain name when doing stuff like rss feeds and so on.

  • Olov 27 posts 101 karma points
    Feb 19, 2010 @ 11:10
    Olov
    0

    It's configurable in TinyMCE, havn't got a clue on where the config is in Umbraco though ;)

    http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/remove_script_host

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Feb 19, 2010 @ 11:11
  • Sjorsp 6 posts 23 karma points
    Feb 19, 2010 @ 11:16
    Sjorsp
    0

    Does it maybe help if you use the BASE tag?

  • dandrayne 1138 posts 2262 karma points
    Feb 19, 2010 @ 11:18
    dandrayne
    100

    Also, a cheeky littly umbraco.library:Replace($content, '/media/', 'http://yoursite.com/media/') might be enough

    Dan

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Feb 19, 2010 @ 11:20
    Peter Gregory
    4

    ok apparently you can change the settings that you want absolute urls with tinymce by doing the following.

    In Umbraco you can find tinyMCE settings in tiny_mce.js file which is in folder Umbarco/umbraco_client/tinymce3

    // two settings for absolute urls
    remove_script_host:0 (which is remove_script_host: false)
    convert_urls:0 (which is convert_ursl: false)

    courtesy of http://jigneshp.wordpress.com/

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Feb 19, 2010 @ 11:58
    Ismail Mayat
    1

    Guys,

    Many thanks for the suggestions have upped all the good ones via like button.  

    1. Peter the useDomainPrefixes does not work with media

    2. Peter tried changing the tinyme settings also change one extra one namely relative_urls:0 no joy also one issue with this will be upgrades and keeping note.

    3. Dan,Morten looks like its time for some regex magic :-}

    Appreciate all the help

    Regards

     

    Ismail 

Please Sign in or register to post replies

Write your reply to:

Draft