No display of content even tho there is content!

Last post 01-17-2014, 10:25 AM by AndyFel. 3 replies.
Sort Posts: Previous Next
  •  01-16-2014, 1:30 PM 78773

    No display of content even tho there is content!

    Hi

     

    When I load or paste the below in the editor, the editor is completely blank. Switch to HTML view and its there, goto preview or wysywig view and nothing shows.

     

    Are you able to find out why it shows nothing?

    Thanks 

     

     <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head>
          <title>[acms:pagetitle]</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
          <meta content="[acms:navtitle]" name="Navigation_Title" /><!-- "Description" -->
          <style>
          a.topmenubar:link
          {
          color: #ffffff;
          text-decoration: none;
          font-weight: bold;
          font-size: 0.90em;
          margin: 1.0em 0em 1.0em 0em;
          padding: 0 5px 0px 5px;
          }
          a.topmenubar:visited
          {
          color: #ffffff;
          text-decoration: none;
          font-weight: bold;
          font-size: 0.9em;
          margin: 1.0em 0em 1.0em 0em;
          padding: 0 5px 0px 5px;
          }
          a.topmenubar:hover
          {
          text-decoration: none;
          font-weight: bold;
          color: #cccccc;
          font-size: 0.9em;
          margin: 1.0em 0em 1.0em 0em;
          padding: 0 5px 0px 5px;
          }
          a.topmenubar:active
          {
          color: #ffffff;
          text-decoration: none;
          font-weight: bold;
          font-size: 0.9em;
          margin: 1.0em 0em 1.0em 0em;
          padding: 0 5px 0px 5px;
          }
          <div style="background: url(previewfile.ashx?id=3033); width: 100%; height: 95px"><img style="float: right" alt="logo" src="previewfile.ashx?id=3031" /> <img alt="logo" src="previewfile.ashx?id=3032" />
          <div style="left: 0px; top: 58px">&nbsp; <a class="topmenubar" href="/@@autolink/429@@@">Home &nbsp;</a> <a class="topmenubar" href="https://www.armycms.mod.uk/">Log In &nbsp;</a> <a class="topmenubar" href="/@@autolink/884@@@">News &nbsp;</a> <a class="topmenubar" href="/@@autolink/883@@@">Training &nbsp;</a> </div>
          </div>
          <table cellpadding="0" width="100%">
              <tr>
                  <td id="maincontent">
                  <table style="background-color: #ffffff" cellspacing="10" cellpadding="10" width="100%" border="0">
                      <tr>
                          <td><!-- MAIN CONTENT START-->[acms:html]<!-- MAIN CONTENT END-->xcvxcvxcv </td>
                      </tr>
                  </table>
                  <!-- FOOTER START -->
                  <table id="footer" cellspacing="0" cellpadding="0" width="100%" border="0">
                      <tr>
                          <td valign="top" align="left" width="100%">
                          <div id="print" style="text-align: center"></div>
                          </td>
                      </tr>
                  </table>
                  <!-- FOOTER END --></td>
              </tr>
          </table>
          </style>
      </head>
    </html>
    &nbsp;
     
  •  01-16-2014, 1:39 PM 78774 in reply to 78773

    Re: No display of content even tho there is content!

    OK, so should have tested in our old system and it doesn't show anything there either, so this example I was testing against is probably screwed up somewhere. 

     

    Don't spend too much time on this, it would be vagually interesting to see why it doesn't show anything. 

    I would delete this post if I could.....

      
  •  01-17-2014, 6:38 AM 78780 in reply to 78774

    Re: No display of content even tho there is content!

    OK I do have a problem altho its not quite what I thought earlier.

     

    What I have found is that I set the  editor.Text in the .NET code my HTML is being mangled here!

    I set the text to the below, then check the .text property in the VS Text Visualiser and its mangled the HTML to the version I pasted previously. The old editor is working OK, when I quickly tested it in the previous post I had pasted the mangled html into the source view and it showed nothing. However when setting the text with the below it leaves it alone and it shows correctly at the browser.

     

     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
       <head>
           <title>[acms:pagetitle ]</title>
           <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
           <meta content="[acms:navtitle ]" name="Navigation_Title" /><!-- "Description" -->
           <meta content="[acms:keywords ]" name="Keywords" />
           <meta content="[acms:description ]" name="Description" />
           <meta content="D CBM (A)" name="Owner" />
           <meta content="[acms:fullname ]" name="Content_Contact" />
           <meta content="[acms:telephone ]" name="Telephone" />
           <meta content="[acms:email ]" name="Email" />
           <meta content="Unclassified" name="Protective_Marking" />
           <meta content="Releaseable" name="FOI_Status" />
           <meta content="UK Crown Copyright" name="Copyright" /><!-- Anti - Caching tags -->
           <meta content="noarchive" name="robots" />
           <meta http-equiv="pragma" content="no-cache" />
           <meta http-equiv="cache-control" content="no-cache" />
           <meta content="noarchive" name="googlebot" />
           <meta http-equiv="expires" content="Sat, 01 Jan 2000 00:00:00 GMT" />
           <style type="text/css">
           <!--
           [acms:styles]
           body {
           font-family:Arial, Helvetica, sans-serif;
           font-size:small;
           margin-left: 0px;
           margin-top: 0px;
           margin-right: 0px;
           margin-bottom: 0px;
           background-color:#ffffff;}
           @media print{
           body{ background-color:#FFFFFF; background-image:none; color:#000000 }
           #header{ display:none;}
           #navigation{ display:none;}
           #maincontent{ width:100%;}
           #footer{ display:none;}
           }
           //-->
           </style>
           <style>
           a.topmenubar:link
           {
           color: #ffffff;
           text-decoration: none;
           font-weight: bold;
           font-size: 0.90em;
           margin: 1.0em 0em 1.0em 0em;
           padding: 0 5px 0px 5px;
           }
           a.topmenubar:visited
           {
           color: #ffffff;
           text-decoration: none;
           font-weight: bold;
           font-size: 0.9em;
           margin: 1.0em 0em 1.0em 0em;
           padding: 0 5px 0px 5px;
           }
           a.topmenubar:hover
           {
           text-decoration: none;
           font-weight: bold;
           color: #cccccc;
           font-size: 0.9em;
           margin: 1.0em 0em 1.0em 0em;
           padding: 0 5px 0px 5px;
           }
           a.topmenubar:active
           {
           color: #ffffff;
           text-decoration: none;
           font-weight: bold;
           font-size: 0.9em;
           margin: 1.0em 0em 1.0em 0em;
           padding: 0 5px 0px 5px;
           }
           </style>
           <link href="[acms:template field=stylesheet]" type="text/css" rel="stylesheet" />
    <script type="text/javascript"><!---
    [acms:scripts]
    //--></script></head>
    <body>
       <div style="background-image: url(https://www.armycms.mod.local/site/previewfile.ashx?id=3033); width: 100%; height: 95px; background-position: initial initial; background-repeat: initial initial;"><img style="float: right" alt="logo" src="previewfile.ashx?id=3031" /> <img alt="logo" src="previewfile.ashx?id=3032" />
       <div style="left: 0px; position: absolute; top: 58px;">&nbsp; <a class="topmenubar" href="/@@autolink/429@@@">Home &nbsp;</a> <a class="topmenubar" href="https://www.armycms.mod.uk/">Log In &nbsp;</a> <a class="topmenubar" href="/@@autolink/884@@@">News &nbsp;</a> <a class="topmenubar" href="/@@autolink/883@@@">Training &nbsp;</a> </div>
       </div>
       <table cellpadding="0" width="100%">
           <tr>
               <td id="maincontent">
               <table style="background-color: #ffffff" cellspacing="10" cellpadding="10" width="100%" border="0">
                   <tr>
                       <td><!-- MAIN CONTENT START-->[acms:html]<!-- MAIN CONTENT END--> </td>
                   </tr>
               </table>
               <!-- FOOTER START -->
               <table id="footer" cellspacing="0" cellpadding="0" width="100%" border="0">
                   <tr>
                       <td valign="top" align="left" width="100%">
                       <div id="print" style="text-align: center"></div>
                       </td>
                   </tr>
               </table>
               <!-- FOOTER END --></td>
           </tr>
       </table>
    </body>
    </html>

  •  01-17-2014, 10:25 AM 78785 in reply to 78780

    Re: No display of content even tho there is content!

    Right have spent all day looking at this!

    I have found a fix for it and its basically setting various properties on the editor in the right place and order! In a nutshell I had to set

    Protected Sub form1_Init(sender As Object, e As EventArgs) Handles form1.Init   Editor1.AllowScriptCode = True   Editor1.EditCompleteDocument = True   Editor1.TagBlackList = ""
    End Sub
     

    I don't normally use form_init, I usually do things once in page_load if not page.ispostback.

    Protected Sub form1_Load(sender As Object, e As EventArgs) Handles form1.Load
      If Not Page.IsPostBack Then
       Editor1.AllowScriptCode = True  Editor1.EditCompleteDocument = True  Editor1.TagBlackList = ""    Using objRdr As System.Data.SqlClient.SqlDataReader = SiteDB.SiteSelectPageHTML(881)
          If objRdr.Read() Then
            If objRdr("DocTypeDTDID") = Globals.DTDTypes.HTML4_01Trans Then
              Editor1.DesignDocType = RTE.RTEDesignDocType.HTML4
            ElseIf objRdr("DocTypeDTDID") = Globals.DTDTypes.XHTML1_0Trans Then
              Editor1.DesignDocType = RTE.RTEDesignDocType.XHTML
            Else
              Editor1.DesignDocType = RTE.RTEDesignDocType.HTML5
            End If
            Editor1.Text = objRdr("HTML")
          End If
        End Using
      End If
    End Sub 

     

    However doing it here only works when you set the text, the settings seem to have been forgotten on the return postback, it seems you have to set them in init everytime whether its the first time the page is loading or being posted back. I also found I had to set them before I set the text property. This all worked in the old version, so was sort of expecting this to work in the same way.

     

    I do think its a bug in that it forgets you set the settings

      Editor1.AllowScriptCode = True   Editor1.EditCompleteDocument = True
      Editor1.TagBlackList = "" 

View as RSS news feed in XML