Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
ASP Code Block in Body Copy?

 

 


BillG
User

Oct 14, 2009, 8:49 PM

Post #1 of 11 (6873 views)
Shortcut
ASP Code Block in Body Copy? Can't Post

I need to be able to include ASP code blocks in my AM body copy.

Something like this:

This is the body copy of my article. <%=ASPVariable%> Here is more text.

I need to be able to allow the <%=ASPVariable%> code to be inserted in my article.

I've spent the past two days learning how tinyMCE works and I've succeeded in getting the editor to accept and save the code block (yeah!). However, since the latest patch, when I publish the article, AM removes the code block from the source.

In the Admin settings, under Dynamic SSI Parsing, I have Server Resolved checked.

The file settings.dat.cgi contains the following line:
'disable_php_asp_code_from_input' => '0',
(which should ALLOW code blocks?)

Is there a setting I'm missing? This issue is extremely critical to me!


(This post was edited by BillG on Oct 14, 2009, 9:37 PM)


Dave
Staff / Moderator


Oct 14, 2009, 9:45 PM

Post #2 of 11 (6868 views)
Shortcut
Re: [BillG] ASP Code Block in Body Copy? [In reply to] Can't Post

Hi BillG,

>I've succeeded in getting the editor to accept and save the code block (yeah!).

Great, if tinyMCE is saving the code blocks it should make it a lot easier to resolve.

Can you post what changes you made (if any) to get tinyMCE to accept and save code blocks?

I'll replicate those locally and run some tests.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com
 


BillG
User

Oct 15, 2009, 9:51 AM

Post #3 of 11 (6844 views)
Shortcut
Re: [Dave] ASP Code Block in Body Copy? [In reply to] Can't Post

See attached zip. Rename tiny_mce_bg.js to tiny_mce.js and substitute for the existing file in the AM /wysiwyg server directory

I've changed how you initially configured tinyMCE (see the setting changes in the line that begins with t.settings). The changes are focused on creating the shortest and most efficient HTML, which includes attempting to disable the useCSS option of execCommand. I am more concerened with backwards compatibility and efficient HTML than W3C compliance. Actually, I am OBSESSED with efficient HTML...

This is my reference for most of the configuration changes:
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration

It's important to know that I'm not strong on JavaScript. I did the best I could, but it appears that due to something I don't understand, the text color button as displayed on the editor is a little skewed in IE8.

According to AM2 documentation, I have AM2 properly configured to allow for code blocks in settings.dat.cgi (see my OP), but AM isn't reading the configuration file correctly (but I'm not strong on Perl, either... HTML and ASP are my strengths). After a long and tedious search, I found that the AM codeblock removal routine is in the AM file ReadForm.pm

I can insert ASP code blocks from the tinyMCE HTML view. It will save the code block, but AM is ignoring the setting in settings.dat.cgi.

Thanks for your support!


(This post was edited by BillG on Oct 15, 2009, 9:52 AM)
Attachments: tiny_mce_bg.zip (45.3 KB)


Dave
Staff / Moderator


Oct 15, 2009, 1:11 PM

Post #4 of 11 (6835 views)
Shortcut
Re: [BillG] ASP Code Block in Body Copy? [In reply to] Can't Post

Hi BillG,

I updated the /wysiwyg/tiny_mce.js file, refreshed, then clicked "HTML View" in the wysiwyg, added this code <%=ASPVariable%> and clicked Update. But when I clicked HTML View again the code was gone. I also tried saving withing clicking the HTML button again and the ASP tag wasn't saved in the database.

Does this work in your browser? I'm using Chrome (webkit based browser). It may be that it doesn't work in all browsers, or there may be a step I missed.

While I'm waiting to hear back you on that I discovered another approach for maintaining server side code in the WYSIWYG with this plugin (CodeProtect):
http://sourceforge.net/tracker/index.php?func=detail&aid=2859676&group_id=103281&atid=738747

I've attached some updated files to enable the codeprotect plugin for tinymce. Server Code now appears as an icon in the wysiwyg and can be pasted through the HTML or new "CodeProtect" button.

I also included the uncompressed /wysiwyg/tiny_mce_src.js file as this will be a lot easier to understand if you want to make changes to it. (Just rename it to tiny_mce.js). If you like to optimize the output tinyMCE will be a great component for you as it is frequently updated and has many features and addons.

I realize this isn't the approach you were taking but hopefully it accomplishes the same end. If not, or if you're still not getting ASP tags in your output let me know what's happening and I'll do my best to assist.

Dave Edis - Senior Developer
interactivetools.com
 
Attachments: artman_2_16 (tinymce codeprotect patch).zip (86.5 KB)


BillG
User

Oct 15, 2009, 2:31 PM

Post #5 of 11 (6826 views)
Shortcut
Re: [Dave] ASP Code Block in Body Copy? [In reply to] Can't Post

I just tried using AM2 TinyMCE in Chrome and I agree, it behaves differently. Yes, it removed the code block for me, too. Firefox changed the code block to &lt;%=ASPVariable%&gt;

Also, when I changed the text color to blue, in IE8 and Firefox 3.5.3 I see the source opening tag as
<font color="#0000FF">

but Chrome creates
<font class="Apple-style-span" color="#0000FF">

I did a Google search and it appears that Chrome's JavaScript engine acts strangely with WYSIWYG editors.

I use IE8, FF and Chrome. I use AM2 in IE8.

the code protext plugin I had once looked at appeared to prevent code blokcs from being inserted - I'll take a look at your reference.


(This post was edited by BillG on Oct 15, 2009, 2:33 PM)


Dave
Staff / Moderator


Oct 15, 2009, 3:00 PM

Post #6 of 11 (6821 views)
Shortcut
Re: [BillG] ASP Code Block in Body Copy? [In reply to] Can't Post

Ok, let me know how it turns out.

Dave Edis - Senior Developer
interactivetools.com
 


BillG
User

Oct 15, 2009, 3:29 PM

Post #7 of 11 (6820 views)
Shortcut
Re: [Dave] ASP Code Block in Body Copy? [In reply to] Can't Post

But my original issue still stands - I still need AM2 with IE8 to accept the codeblock! Tiny MCE works as expectged in IE8 and saves the codeblock, but AM2 is ignoring the configuration setting and stripping oout the code block as previously explained. AM2 doesn't appears to be processing settings.dat.cgi as documented.


(This post was edited by BillG on Oct 15, 2009, 3:30 PM)


Dave
Staff / Moderator


Oct 15, 2009, 3:41 PM

Post #8 of 11 (6817 views)
Shortcut
Re: [BillG] ASP Code Block in Body Copy? [In reply to] Can't Post

I just tested and I have it working locally with IE8. It's allowing me to insert ASP code blocks and publish them. So it's definitely possible. We just need to determine what is different between my configuration and yours.

What appears where the code block should be? Just whitespace or does it have the "CODEBLOCK DISABLED" comment tag?

And when you say it's stripping out the codeblock, you're looking at the file from FTP right? Not viewing source on the web page?

Let me know.

Dave Edis - Senior Developer
interactivetools.com
 


Dave
Staff / Moderator


Oct 16, 2009, 9:55 AM

Post #9 of 11 (6812 views)
Shortcut
Re: [Dave] ASP Code Block in Body Copy? [In reply to] Can't Post

Any update on this? I know this issue was very critical for you so I wanted to make sure it got resolved.

If not, let me know where your at so we can figure out what the next step is to get it resolved.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com
 


BillG
User

Oct 19, 2009, 11:35 AM

Post #10 of 11 (6774 views)
Shortcut
Re: [Dave] ASP Code Block in Body Copy? [In reply to] Can't Post

Hi, Dave. Thanks for your patience - I had to put my head inside some urgent tasks that were on deadline.

Good news - I got it working! It was a typo in my server-side code that didn't properly process the code block. And the editor changes work, as long as I stick to using IE.

Thank You for your help and I apologize if I my urgency came across as rude in earlier posts.


Dave
Staff / Moderator


Oct 19, 2009, 4:25 PM

Post #11 of 11 (6766 views)
Shortcut
Re: [BillG] ASP Code Block in Body Copy? [In reply to] Can't Post

Great to hear it's working, and glad we could help! :)

Dave Edis - Senior Developer
interactivetools.com