How do I do this?

He means the editor must be set to HTML mode in order to enter and change text 
that contains HTML.

How and where do I set the editor to html mode?


So here is what I do:

The content is saved in the DB.

I open a page (editPage.cfm)
Pull the content from the DB and display it on the page via the form.
IF I view source, 

THIS

<div id="contentFullNoBar"> 
  <!---  ***** breadcrumbs - DO NOT EDIT  *****--->
  <div id="breadCrumbs">
    <cfinclude template="../includes/breadCrumbs.cfm" />
  </div>
  <!--- end bread crumbs --->
  
  <div id="topHalf">
    <div id="HalfLeftThreeQtr">
      <div id="innerLeftThree"> 
        
        <!--- **** left nav menu **** --->
        <cfinclude template="../includes/leftNav.cfm" />
        <!---***** end left nav ***** --->
        
        <div id="contentHalf4"> 
          
          <!--- ***** ADD MAIN CONTENT HERE ***** --->
          
          <cfinvoke component="cfc.citi" method="getFounders"   
returnvariable="founders" />
          <cfinvoke component="cfc.citi" method="getDevelopers"         
returnvariable="developers" />
          <cfinvoke component="cfc.citi" method="getAdvisors"   
returnvariable="advisors" />
          <p>The CITI Program's content has been produced by a diverse team of 
research professionals from around the world, including university-affiliated 
administrators and faculty, independent research professionals, and 
representatives from U.S. federal agencies. . This group of content developers 
is dedicated to providing the highest-quality educational materials for our 
learners, and is lead by the CITI Program Founders and the CITI Program's 
Executive Advisory Committee.</p>
            <cfoutput>
          <table>
            <tbody>
              <tr>
                <td><span class="bbheadingtext">CITI Program 
Founders</span></td>
              </tr>
              <cfloop query="founders">
              
                  <tr>
                    <td>#name#</td>
                    <td>#company#</td>
                  </tr>
             
              </cfloop>
              <tr>
                <td height="20" colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td><span class="bbheadingtext">CITI Program Executive Advisory 
Committee </span></td>
              </tr>
              <cfloop query="advisors">
              
                  <tr>
                    <td>#name#</td>
                    <td>#company#</td>
                  </tr>
             
              </cfloop>
              <tr>
                <td height="20" colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td  colspan="2">The co-founders are provided guidance and 
advice from the CITI Executive Advisory Committee chaired by Ernest Prentice 
Ph.D. <br />
                  <br />
                  The CITI Program remains dynamic and responsive to the needs 
of our learners thanks to the efforts of the CITI Program Developer Group. The 
Group meets periodically to review the courses, make editorial changes and to 
develop new initiatives for the CITI Program. <br />
                  <br /></td>
              </tr>
              <tr>
                <td><span class="bbheadingtext">CITI Developers' 
Group</span></td>
              </tr>
              <cfloop query="developers">
            
                  <tr>
                    <td>#name#</td>
                    <td>#institution#</td>
                  </tr>
               
              </cfloop>
              <tr>
                <td height="20" colspan="2">&nbsp;</td>
              </tr>
            </tbody>
          </table>
           </cfoutput>
          <!--- ***** END MAIN CONTENT  ***** ---> 
          
        </div>
      </div>
    </div>
  </div>
</div>
<!-- END OF MAIN CONTENT AREA--> 



Is changed to this:

<div id="contentFullNoBar">
        <!---  ***** breadcrumbs - DO NOT EDIT  *****--->
        <div id="breadCrumbs">
                <cfinclude template="../includes/breadCrumbs.cfm"> 
</cfinclude></div>
        <!--- end bread crumbs --->
        <div id="topHalf">
                <div id="HalfLeftThreeQtr">
                        <div id="innerLeftThree">
                                <!--- **** left nav menu **** ---><cfinclude 
template="../includes/leftNav.cfm"> <!---***** end left nav ***** --->
                                <div id="contentHalf4">
                                        <!--- ***** ADD MAIN CONTENT HERE ***** 
---><cfinvoke component="cfc.citi" method="getFounders" 
returnvariable="founders"> <cfinvoke component="cfc.citi" 
method="getDevelopers" returnvariable="developers"> <cfinvoke 
component="cfc.citi" method="getAdvisors" returnvariable="advisors">
                                        <p>
                                                The CITI Program&#39;s content 
has been produced by a diverse team of research professionals from around the 
world, including university-affiliated administrators and faculty, independent 
research professionals, and representatives from U.S. federal agencies. . This 
group of content developers is dedicated to providing the highest-quality 
educational materials for our learners, and is lead by the CITI Program 
Founders and the CITI Program&#39;s Executive Advisory Committee.</p>
                                        <cfloop query="founders"> <cfoutput> 
</cfoutput></cfloop><cfloop query="advisors"> <cfoutput> 
</cfoutput></cfloop><cfloop query="developers"> <cfoutput> </cfoutput></cfloop>
                                        <table>
                                                <tbody>
                                                        <tr>
                                                                <td>
                                                                        <span 
class="bbheadingtext">CITI Program Founders</span></td>
                                                        </tr>
                                                        <tr>
                                                                <td>
                                                                        
#name#</td>
                                                                <td>
                                                                        
#company#</td>
                                                        </tr>
                                                        <tr>
                                                                <td colspan="2" 
height="20">
                                                                        
&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                                <td>
                                                                        <span 
class="bbheadingtext">CITI Program Executive Advisory Committee </span></td>
                                                        </tr>
                                                        <tr>
                                                                <td>
                                                                        
#name#</td>
                                                                <td>
                                                                        
#company#</td>
                                                        </tr>
                                                        <tr>
                                                                <td colspan="2" 
height="20">
                                                                        
&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                                <td colspan="2">
                                                                        The 
co-founders are provided guidance and advice from the CITI Executive Advisory 
Committee chaired by Ernest Prentice Ph.D.<br />
                                                                        <br />
                                                                        The 
CITI Program remains dynamic and responsive to the needs of our learners thanks 
to the efforts of the CITI Program Developer Group. The Group meets 
periodically to review the courses, make editorial changes and to develop new 
initiatives for the CITI Program.<br />
                                                                        
&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                                <td>
                                                                        <span 
class="bbheadingtext">CITI Developers&#39; Group</span></td>
                                                        </tr>
                                                        <tr>
                                                                <td>
                                                                        
#name#</td>
                                                                <td>
                                                                        
#institution#</td>
                                                        </tr>
                                                        <tr>
                                                                <td colspan="2" 
height="20">
                                                                        
&nbsp;</td>
                                                        </tr>
                                                </tbody>
                                        </table>
                                        <!--- ***** END MAIN CONTENT  ***** 
---></cfinvoke></cfinvoke></cfinvoke></div>
                                </cfinclude></div>
                </div>
        </div>
</div>
<!-- END OF MAIN CONTENT AREA-->


As you can see everything is distorted. If I hit submit, the distorted code 
will be saved.

I have tried adding the protected tags in the config.js file like so:

CKEDITOR.editorConfig = function( config ) {
        config.protectedSource.push( /<\?[\s\S]*?\?>/g ); 
        config.protectedSource.push(/[^<]*(<h1>([^<]+)<\/h1>)/g);
        config.protectedSource.push( /<cfinclude[\s\S]*?\/cfinclude>/g);
        config.protectedSource.push( /<cfscript[\s\S]*?\/cfscript>/g ); 
        config.protectedSource.push( /<br[\s\S]*?\/>/g );   // BR Tags
        config.protectedSource.push( /<img[\s\S]*?\/>/g );   // IMG Tags
        config.protectedSource.push( /{exp:[\s\S]*?{\/exp:[^\}]+}/g );    // 
Expression Engine style server side code 
        config.protectedSource.push( /{.*?}/g);
        config.protectedSource.push( /<tex[\s\S]*?\/tex>/g);
        config.protectedSource.push( /<object[\s|\S]+?<\/object>/g); // 
Protects <OBJECT> tags 
        config.protectedSource.push( /<style[\s\S]*?\/style>/g); // Protects 
<STYLE> tags
        config.protectedSource.push( /<cfoutput[\s\S]*?\/cfoutput>/g); // 
Protects <CFOUTPUT> tags
        config.protectedSource.push( /<pre[\s\S]*?\/pre>/g);
        config.protectedSource.push( /<code[\s\S]*?\/code>/g);
        config.protectedSource.push( /<cfinclude[\s\S]*?\/cfinclude>/g);
        config.protectedSource.push( /<cfloop[\s\S]*?\/cfloop>/g)       
        };


But it is not working.









>On Wed, 2012-01-11 at 10:03 -0500, Torrent Girl wrote:
>
>> When you say change it to edit mode what do you mean? Do you mean hit "View 
>> Source"?
>> 
>> If so that is what I am doing and where I see the code distorted.
>
>
>He means the editor must be set to HTML mode in order to enter and
>change text that contains HTML.
>
>When in that mode (set at the CK editor  tag itself as an
>attribute....not in a config file if memory serves) it will escape "<"
>and ">" and other such escapements so that when the text is displayed in
>the edoitor it doesn't cause problems.
>
>If you are viewing source on the page to assess what the editor is going
>to save to the DB, you are most likely see crap as you are
>reporting.....but that "crap" should display properly in the editor when
>pulled from the DB and shown.
>
>It really would be best to:
>
>1) show us what you type
>
>2) explain the steps to re-create what you are thinking is wrong (i.e.
>then saved the contents to the database.....then pulled fom DB and
>displayed in editor.....when complete I saw XYZ and it is wrong because
>of ABC being out of place).
>
>If we had the end to end steps we may be better able to help.
>
>Best of luck
>
>Cheers
>
>-- 
>
>
>Bryan Stevenson B.Comm.
>VP & Director of E-Commerce Development
>Electric Edge Systems Group Inc.
>phone: 250.480.0642
>fax: 250.480.1264
>cell: 250.920.8830
>e-mail: br...@electricedgesystems.com
>web: www.electricedgesystems.com
> 
>Notice:
>This message, including any attachments, is confidential and may contain
>information that is privileged or exempt from disclosure. It is intended
>only for the person to whom it is addressed unless expressly authorized
>otherwise by the sender. If you are not an authorized recipient, please
>notify the sender immediately and permanently destroy all copies of this
>message and attachments.
>Please consider the environment before printing this e-mail 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349411
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to