I originally posted here: http://drupal.org/node/253809

I am trying to add some code to my page and the YUI module is interferring with the formating of the code:

This is the code I paste into my page:

<swflist player="wijering_imagerotator"
  files="image1.jpg&&image2.jpg&&image3.jpg&&image4.jpg"
  width="400" height="400" transition="random">

And this is what YUI turns it into:

<strong>
<DIV class=codeblock><CODE>&lt;swflist player="wijering_imagerotator"<br />&nbsp; files="image1.jpg&amp;&amp;image2.jpg&amp;&amp;image3.jpg&amp;&amp;image4.jpg"<br />&nbsp; width="400" height="400" transition="random"&gt;</CODE></DIV></strong>

Any help would be greatly appreciated!

Comments

jeffcd’s picture

What are your yui_editor settings? What version of yui are you using?

jcbrew’s picture

Hi - thanks for the reply:

YUI 6.x-1.1-1 YUI Module

YUI editor 6.x-1.2-91

No Path
No IDs
No Title

height: 250px
width: 100%
markup: xhtml
button profile: default

Checked:
Show titlebar
plaintest button
Show DOM

button type: simple

jeffcd’s picture

I have been trying to replicate the error with no success.

Two more questions:

- Which version of the YUI library are you using? I tried it with 2.5.0 and 2.5.1.
- What drupal input filter are you using on the body field?

jcbrew’s picture

YUI Library - 2.5.0

Do you mean the Input Formats? If so, I've tried it with all three Filter HTML, Full HTML, and PHP code...
I've tried pasting PHP code and HTML code in separate occasions and still get the formatted text instead of code...

vm’s picture

you input format is exposed when you use the collapsed menu under the text area before submitting the node, or by setting a format as default in administer -> input formats

jcbrew’s picture

Thank you for clarifying - I edited my reply above... I finally figured out what he meant - took me awhile...

jcbrew’s picture

I even tried typing

<b>Dog</b>

figuring it was a problem with pasting the code...

and I get

<P><span style="FONT-FAMILY: Courier New">&lt;b&gt;Dog &lt;/b&gt;</span></P>
jcbrew’s picture

I'm not sure if I should be downloading the library and storing it locally or if this location is good:

http://yui.yahooapis.com/2.5.0 or http://yui.yahooapis.com/2.5.1

jeffcd’s picture

Try posting the source html from the offending page so we can take a look at it.

Are you posting the html directly into the editor without going into plain text mode? If so, then it is doing what is expected.

jcbrew’s picture

Steps involved in creating my page:

Click "create Content"

Click on ""page"

Type title : Dog

Switch to Plain Editor >

Select Input format > Full HTML

Type: <b>DOG</b>

Hit Save

Then the body text field goes blank...

Here is the code to the page:

<head>
	<title>Dog | Name</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.1/build/menu/assets/skins/sam/menu.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.1/build/button/assets/skins/sam/button.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.1/build/fonts/fonts-min.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.1/build/container/assets/skins/sam/container.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.1/build/autocomplete/assets/skins/sam/autocomplete.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.1/build/editor/assets/skins/sam/editor.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.1/build/resize/assets/skins/sam/resize.css"/>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/utilities/utilities.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/animation/animation-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/element/element-beta-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/container/container-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/menu/menu-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/button/button-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/resize/resize-beta-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/autocomplete/autocomplete-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/editor/editor-beta-min.js"></script>
<link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" />
	<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/yui_editor/yui_editor.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/themes/trentcom/style.css?R" />
	<script type="text/javascript" src="/misc/jquery.js?R"></script>
<script type="text/javascript" src="/misc/drupal.js?R"></script>
<script type="text/javascript" src="/modules/yui_editor/yui_editor.js?R"></script>
<script type="text/javascript" src="/modules/yui_editor/toolbars/yui_editor_toolbar_default.js?R"></script>
<script type="text/javascript">jQuery.extend(Drupal.settings, { "basePath": "/" });</script>
<script type="text/javascript">if (Drupal.jsEnabled) { $(document).ready(function() { $('body').addClass('yui-skin-sam'); } ); };</script>
	<script type="text/javascript"> </script>
</head>

<body id="body second">
<div id="page">
	<div id="wrapper">
		<div id="header">
			<div id="logo">
				<a href="/">			<img src="themes/trentcom/images/logo.jpg" alt="image"></a>
			</div>
			<div id="menu">
					<div id="primary"><div class="block block-menu" id="block-menu-primary-links">
  <div class="blockinner">
    <h2 class="title"> Primary links </h2>
    <div class="content">
      <ul class="menu"><li class="collapsed first"><a href="/index.php?q=news" title="">News</a></li>
<li class="leaf"><a href="/index.php?q=next" title="">Next </a></li>
<li class="leaf"><a href="http://www.....com/forums/forumdisplay.php?f=11" title="">Message Board</a></li>
<li class="leaf"><a href="/index.php?q=bio" title="Driver Bio">Bio</a></li>
<li class="leaf"><a href="http://www.....com" title="">Gallery</a></li>
<li class="leaf"><a href="/index.php?q=partners" title="">Partners</a></li>
<li class="leaf last"><a href="http://www....com" title="">Fan Club</a></li>
</ul>    </div>
  </div>
</div>
</div>
			</div>
		</div><!-- header end -->
					<div id="in">
				<div id="left">
					<div class="block block-user" id="block-user-1">
  <div class="blockinner">
    <h2 class="title"> jcbrew </h2>
    <div class="content">
      <ul class="menu"><li class="leaf first"><a href="/index.php?q=user/1">My account</a></li>
<li class="collapsed"><a href="/index.php?q=node/add">Create content</a></li>
<li class="collapsed"><a href="/index.php?q=admin">Administer</a></li>
<li class="leaf last"><a href="/index.php?q=logout">Log out</a></li>
</ul>    </div>
  </div>
</div>
									</div>
				<div id="content">
					<div class="breadcrumb"><a href="/">Home</a></div>										<h1 class="title">Dog</h1>					<div class="tabs"><ul class="tabs primary">
<li class="active" ><a href="/index.php?q=node/20" class="active">View</a></li>
<li ><a href="/index.php?q=node/20/edit">Edit</a></li>
</ul>
</div>										<div class="messages status">
Page <em>Dog</em> has been created.</div>
					<div class="node" id="node-20">
  
    
  
    
  <div class="content">
      </div>
  
    
</div>
    
					<script type="text/javascript">render_editor('edit-body', {height: '250px', width: '100%', markup: 'xhtml', resize: '0', plaintext: 1, coder: 0, dom: 1, collapse: 0, draggable: 0, buttonType: 'simple', titlebar: 1, title: ''});</script>
				</div>
				<div id="clear"></div>
			</div><!-- in end -->
						<div id="clear"></div>
		</div><!-- in end -->
	</div><!-- wrapper end -->
	<div id="footer">		<div id="footermenu"></div>
	</div>
</div><!-- page end -->
jeffcd’s picture

Try upgrading to 6.x-1.2-94 and the body field shouldn't go blank.

jeffcd’s picture

My yahoo ID is jcd_7. i'll give you live help if I am online and have the time.

jcbrew’s picture

yui_editor 6.x-1.2-93 is the latest available I can download... I'll give it a try.

Thanks

jeffcd’s picture

Status: Active » Closed (fixed)

No posts have been made on this in a week so I am going to assume it is resolved. Re-open the issue with more details if necessary. Thanks.

WallyJtD’s picture

Version: 6.x-1.2-91 » 5.x-2.6-96
Status: Closed (fixed) » Active

I'm having a similar problem with this editor; by going into plain text and setting input format to PHP, I can write code into the textarea, then save - and it displays. However, if I try to edit it, the edit function opens with the YUI editor in rich text mode, and if I switch to plain text, it's gone - nothing is displayed.

I have the php opener and closer correctly set; the php works because when the page was created and saved, it did what it was supposed to.

a) is there a way to force YUI editor to open in plain text mode if input format is PHP?
b) is there a way for YUI editor not to make any kind of parsing attempt on anything within the php tags?
c) has anyone else found this to be an issue?

TIA

jeffcd’s picture

Status: Active » Closed (fixed)

I am going to move #15 to a separate feature request because I think it brings up some good points and it also is different from the original bug.