<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tiny MCE replaces paths with relative urls in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154168#M108652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;SPAN&gt;Alfresco 2.9.0B is using Tiny MCE to edit HTML content inline.&amp;nbsp; My problem is that when my A/@HREF or IMG/@SRC does not start with "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow noopener noreferrer"&gt;http://&lt;/A&gt;&lt;SPAN&gt;" or "/", tiny MCE prepends the path of the editor to the URLs!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The configuration is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;tinyMCE.init({&lt;BR /&gt;theme : "advanced",&lt;BR /&gt;mode : "exact",&lt;BR /&gt;relative_urls: false,&lt;BR /&gt;elements : "editor",&lt;BR /&gt;save_callback : "saveContent",&lt;BR /&gt;plugins : "table",&lt;BR /&gt;theme_advanced_toolbar_location : "top",&lt;BR /&gt;theme_advanced_toolbar_align : "left",&lt;BR /&gt;theme_advanced_buttons1_add : "fontselect,fontsizeselect",&lt;BR /&gt;theme_advanced_buttons2_add : "separator,forecolor,backcolor",&lt;BR /&gt;theme_advanced_buttons3_add_before : "tablecontrols,separator",&lt;BR /&gt;theme_advanced_disable: "styleselect",&lt;BR /&gt;extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]"&lt;BR /&gt;});&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;When HTML content is edited in alfresco with the TinyMCE editor, "/alfresco/faces/jsp/browse/" is prepended to img/@src and a/@href values.&amp;nbsp; I have tested and verified that this only occurs in the following situations:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;when src or href does not start with "http://" or "/".&lt;BR /&gt;Example 1: "${context}/images/test.gif" gets replaced with "/alfresco/faces/jsp/browse/${context}/images/test.gif"&lt;BR /&gt;Example 2: "@CONTEXT@/images/test.gif" gets replaced with "/alfresco/faces/jsp/browse/@CONTEXT@/images/test.gif"&lt;/UL&gt;&lt;SPAN&gt;The conversion occurs when I click the "Update" button on the Tiny MCE HTML Source editor.&amp;nbsp; I verified this by changing the @src of an img tag from "/images/text.gif" to "${context}/images/text.gif", then clicking on the Image properties in the Tiny MCE advanced editor.&amp;nbsp; The path had already been changed to "/alfresco/faces/jsp/browse/${context}/images/test.gif".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "Insert/edit Image" dialog also exhibits this behavior.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have multiple web sites configured to pull HTML content from one Alfresco server via the web service client API.&amp;nbsp; In order for href and src URLs to point to the right place, I must use a token within the URL to represent the destination context.&amp;nbsp; This token is replaced by the website requesting the content, with the context in which the website has been deployed, not alfresco.&amp;nbsp; The Alfresco web server is not publically accessible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am trying to accomplish is this - when a piece of content is pulled from Alfresco like '&amp;lt;img src="${context}/images/text.gif"&amp;gt;', then the website replaces ${context} with the webapp's context like this '&amp;lt;img src="/testapp1/images/text.gif"&amp;gt;'.&amp;nbsp; Then the content is sent to the browser and the image will load properly from the public website.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Feb 2008 20:46:27 GMT</pubDate>
    <dc:creator>stevewickii</dc:creator>
    <dc:date>2008-02-08T20:46:27Z</dc:date>
    <item>
      <title>Tiny MCE replaces paths with relative urls</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154168#M108652</link>
      <description>Alfresco 2.9.0B is using Tiny MCE to edit HTML content inline.&amp;nbsp; My problem is that when my A/@HREF or IMG/@SRC does not start with "http://" or "/", tiny MCE prepends the path of the editor to the URLs!The configuration is:tinyMCE.init({theme : "advanced",mode : "exact",relative_urls: false,elements</description>
      <pubDate>Fri, 08 Feb 2008 20:46:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154168#M108652</guid>
      <dc:creator>stevewickii</dc:creator>
      <dc:date>2008-02-08T20:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny MCE replaces paths with relative urls</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154169#M108653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;maybe &lt;/STRONG&gt;&lt;SPAN&gt;if you change the configuration:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;relative_urls: false for&amp;nbsp; relative_urls: true, the behavior is good. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, I have a question:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ã‚Â¿Where can you modify this Tiny MCE configuration? Ã‚Â¿Which is the right file?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2008 18:15:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154169#M108653</guid>
      <dc:creator>tonizz</dc:creator>
      <dc:date>2008-02-21T18:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny MCE replaces paths with relative urls</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154170#M108654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;it took us weeks of playing with the config to learn this but it appears that this is an issue only in IE6, IE7 however it works alright in FF. Anyway there is a fix for it &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Change tiny_mce_extensions.js&amp;nbsp; located at /jsp/scripts/ajax/ add the following code to the alfresco_TinyMCE_urlconverter_callback() function…&lt;BR /&gt;&lt;BR /&gt;if (tinyMCE.isMSIE)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var server = document.location.protocol + "//" + document.location.host;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (href &amp;amp;&amp;amp; href.startsWith(server))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = href.substring(server.length);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Add it to the end of the method i.e. just before the "return result;"&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Credit to Gavin and Tom… !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 11:12:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154170#M108654</guid>
      <dc:creator>ctrl</dc:creator>
      <dc:date>2008-03-31T11:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny MCE replaces paths with relative urls</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154171#M108655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I appreciate the suggestion!&amp;nbsp; Unfortunately, it doesn't work for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using Alfresco 2.9.0B build 683, so things may have been moved around.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First, I couldn't find tiny_mce_extensions.js or a folder named /jsp/scripts/ajax.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I tried adding the code you suggested to a file I do have: /scripts/ajax/tine_mcs_wcm_extensions.js.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, this didn't fix my problem.&amp;nbsp; I also tried adding an alert() to the beginning of the alfresco_TinyMCE_urlconverter_callback() function, and it never gets invoked, so I don't think this javascript is even being executed by tiny mce.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 May 2008 21:33:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154171#M108655</guid>
      <dc:creator>stevewickii</dc:creator>
      <dc:date>2008-05-01T21:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny MCE replaces paths with relative urls</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154172#M108656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We can not deny the fact that the economy is experiencing financial crisis. RealtyTrac's quarterly report on the foreclosure industry showed that more than a fourth of all domestic home sales during the first quarter of the year were deals on foreclosure properties. Excessive foreclosures bring down the cost of homes, making market recover more difficult. The news, regarded with last week’s grim jobs report, further supports the conclusion that the slow economic recovery is not picking up much steam at the moment. Article resource: &lt;/SPAN&gt;&lt;A href="https://personalmoneynetwork.com/" rel="nofollow noopener noreferrer"&gt;https://personalmoneynetwork.com/&lt;/A&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 11:20:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/tiny-mce-replaces-paths-with-relative-urls/m-p/154172#M108656</guid>
      <dc:creator>zhunjier</dc:creator>
      <dc:date>2014-09-05T11:20:53Z</dc:date>
    </item>
  </channel>
</rss>

