Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > HTML area (formatted text) field in document type editor displays as blank despite having HTML in database View modes: 
User avatar
Member
Member
joeh42 - 3/1/2012 11:12:14 AM
   
HTML area (formatted text) field in document type editor displays as blank despite having HTML in database
I have a field of type long text. It's an input form control of type HTML area (formatted text).

I'm in the process of moving data from other fields into this new one. The other ones will be deprecated eventually. I'm doing so, I wrote some SQL that compiles the existing text and HTML area fields into the new field.

I added a static text webpart to my document and displayed the text. It looks great, and I can switch back and forth between the two database fields as needed without any additional changes. I also reviewed the HTML in SQL and it looks like it's formatted the same as the old fields.

However, when I go to edit a document of this document type, the HTML area control always displays as blank. I need my content editor to be able to use the html editor to modify the HTML in the future.

Why does it display as blank? Does it need to have a specific formatting? If so, is there an API call I can make to the convert the text into the correct format?

I've looked at multiple documents to make sure that the behavior is consistent and not a caching issue...

Please help!
Thanks,
Joe Hoppe

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/4/2012 8:38:20 AM
   
RE:HTML area (formatted text) field in document type editor displays as blank despite having HTML in database
Hi,

What place you mean by "when I go to edit a document of this document type"?

The static text web part and also editable regions and everything what is being edited on the Page tab is being saved to CMS_Document table, which means it is directly connected to one, particular document. So, if you do not have the document's context, it appears to be blank.

Could you please explain where are you checking the HTML in the database?

Best regards,
Juraj Ondrus

User avatar
Member
Member
joeh42 - 3/5/2012 9:27:03 AM
   
RE:HTML area (formatted text) field in document type editor displays as blank despite having HTML in database
Juraj,

What place you mean by "when I go to edit a document of this document type"?

If I go to the CMS Desk, find the document in the content tree, and go to the 'form' tab of that document, the HTML text area field renders as blank. When I click on source, the field is still blank.

Could you please explain where are you checking the HTML in the database?

I have been checking the database using SQL Server mgmt studio. I.e.
SELECT [ArticleText] FROM [custom_Article]


I also confirmed that the documents were previously and are still published.

Would using the API to move the data solve this issue?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/6/2012 2:32:21 AM
   
RE:HTML area (formatted text) field in document type editor displays as blank despite having HTML in database
Hi,

I am sorry but I am still confused - in your last post you mentioned Form tab - where the document type fields are used but in the first post you mentioned static text webpart which is placed on the Design tab and edited on the Page tab. The Page and Form tab "editable fields" are different and the content is stored in different places.

Could you please explain the issue in more details what and where is being switched, displayed and not displayed?

Thank you.

Best regards,
Juraj Ondrus

User avatar
Member
Member
joeh42 - 3/6/2012 8:34:31 AM
   
RE:HTML area (formatted text) field in document type editor displays as blank despite having HTML in database
Hi Juraj,

I'm going to try and explain this end to end to make more sense. Hope it helps.

In my document type 'health article,' I created a new field named 'ArticleText' of type long text. It's an input form control of type HTML area (formatted text).

I'm in the process of moving data from other database fields into this new one. I wrote some SQL that will concatenate the existing database columns into the right format and insert them into ArticleText.

I ran that SQL, and then I verified that the data looks correct in the table (customArticle) using SQL Server management studio. I've also added a static text webpart to the front end page that displays the document to confirm that when I render the document, the field is displayed in the format I am expecting. They do. It displays the text, and the data appears to be in the same format as other Kentico HTML area fields.

The problem is...

If I go to the CMS Desk, find any health article document that I modified in the left navigation content tree, and go to the 'form' tab of that document (i.e. page / design / form / properties / analytics), I'm displaying the default editing form of the document. I see the field 'ArticleText' and the HTML area form control next to it. However, the HTML area form control always renders without any data in it. it's blank. If I click on source, that's also blank. If I query the database, I can see that there's data in the field. I need to be able to give my content editor the ability to edit this database field to maintain the document moving forward. If the field displays as blank, then she cannot easily do so.

Why does the ArticleText HTML area render as blank in the default editing form in the CMS Desk? When I change the text area to display the HTML source, why is it also blank?

The page tab is not relevant to the discussion, so I hope I did not mislead you by referencing it.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/6/2012 8:43:04 AM
   
RE:HTML area (formatted text) field in document type editor displays as blank despite having HTML in database
Hi,

Thank you for the explanation. What I am missing is where in the DB are you storing the HTML for that field? I guess it is in CMS_Document -> DocumentContent column.

As I mentioned before, the field added to the document type is totally different from the editable text or static text web part.

Please, see the content management internals for more details:
But, basically - the values for the fields on the Form tab are saved to the coupled data table and the value of the editable web parts which are available on the Page tab is saved to CMS_Document table.

If I am getting the right meaning, you want to allow the editors to edit the values on the Form tab? Is that correct?

Best regards,
Juraj Ondrus

User avatar
Member
Member
joeh42 - 3/13/2012 2:01:26 PM
   
RE:HTML area (formatted text) field in document type editor displays as blank despite having HTML in database
The issue was that the document type was under workflow. It was not clear that the form control is pulling the value from the workflow, as opposed to the latest database value.