<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Roa » The Blog &#187; MODx</title>
	<atom:link href="http://www.johnroa.net/category/programming/modx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnroa.net</link>
	<description>Web design, marketing, photography, traveling and more...</description>
	<lastBuildDate>Tue, 04 May 2010 15:02:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MODx: TinyMCE relative URL hack</title>
		<link>http://www.johnroa.net/2010/01/25/modx-tinymce-relative-url-hack/</link>
		<comments>http://www.johnroa.net/2010/01/25/modx-tinymce-relative-url-hack/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 17:44:30 +0000</pubDate>
		<dc:creator>John Roa</dc:creator>
				<category><![CDATA[MODx]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.johnroa.net/?p=49</guid>
		<description><![CDATA[MODx version: Revolution 2.0.0-beta-5 rev6224
TinyMCE: 3.2.7.0
There is a current bug that I have seen a lot of activity about in the forums regarding TinyMCE and relative paths, specifically when inserting images. Essentially, even though the path inside the image selector in TinyMCE says &#8220;/assets/images/xyz.jpg&#8221;, it changes it to &#8220;../../assets/images/xyz.jpg&#8221; upon inserting.
While this isn&#8217;t a very [...]]]></description>
			<content:encoded><![CDATA[<p>MODx version: Revolution 2.0.0-beta-5 rev6224<br />
TinyMCE: 3.2.7.0</p>
<p>There is a current bug that I have seen a lot of activity about in the forums regarding TinyMCE and relative paths, specifically when inserting images. Essentially, even though the path inside the image selector in TinyMCE says &#8220;/assets/images/xyz.jpg&#8221;, it changes it to &#8220;../../assets/images/xyz.jpg&#8221; upon inserting.</p>
<p>While this isn&#8217;t a very graceful fix, it is a noted bug, so hopefully this gets everyone through to the official patch:</p>
<ol>
<li> Navigate to /core/components/tinymce/tinymce.class.php</li>
<li> Scroll down to line 134, and you will find:</li>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p49code3'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p493"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code" id="p49code3"><pre class="php" style="font-family:monospace;">        <span style="color: #666666; font-style: italic;">/* Set relative URL options */</span>
        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'path_options'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'rootrelative'</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'relative_urls'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'remove_script_host'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'docrelative'</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'relative_urls'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'document_base_url'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'assets_url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'remove_script_host'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'fullpathurl'</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'relative_urls'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'remove_script_host'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<li>This is looking for a system configuration variable called &#8220;path_options&#8221;. Who would think to change that, and what to change it to? Rather than making a square peg fit in a round hole, I preferred to just comment that whole statement out and replace it with:</li>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p49code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p494"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p49code4"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'convert_urls'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<li>TinyMCE will now stop converting /assets to ../../assets or whatever other craziness it was doing. A prickly but easy workaround until it is officially fixed.</li>
</ol>
<p>Enjoy,</p>
<p>John</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.johnroa.net%2F2010%2F01%2F25%2Fmodx-tinymce-relative-url-hack%2F&amp;linkname=MODx%3A%20TinyMCE%20relative%20URL%20hack"><img src="http://www.johnroa.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.johnroa.net/2010/01/25/modx-tinymce-relative-url-hack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
