Main text with WYSIWYG

Topics: Developer Forum, User Forum
Feb 3, 2009 at 5:26 PM
hi,

how do i stop the 'main text' form field (with the WYSIWYG editor) being output? i cant see where this gets called!

all i want to appear on my page is an introduction & file upload, as follows:

[

EditableTextBox("Introduction", 90, ContainerName = Tabs.Content, TextMode = TextBoxMode.MultiLine, Rows = 4, Columns = 80)]

 

 

public virtual string Introduction
{

 

 

get { return (string) (GetDetail("Introduction") ?? string.Empty); }

 

 

set { SetDetail("Introduction", value, string.Empty); }
}

 

[

EditableImage("File", 30, ContainerName = Tabs.Content,Required=true,RequiredMessage="Please provide a file")]

 

[

FileAttachment]

 

 

public virtual string FileUpload

 

{

 

get { return (string)base.GetDetail("FileUpload"); }

 

 

set { base.SetDetail("FileUpload", value); }

 

}

Coordinator
Feb 3, 2009 at 9:56 PM
I don't get it. What do you mean by "main text"? N2 looks up the attributes you've added to the properties and the attributes themselves create the appropriate editor control.
May 12, 2009 at 2:16 PM

If Im reading this correctly.....(hopefully) because Im trying to do the same thing.

He wants the Editable "Text" Field to dissappear.....so all your left with is a Title and Name EditableTextboxes.

Any ideas?

GE

Coordinator
May 12, 2009 at 5:15 PM

Somewhere in your class, or in one of the base calsses there is an attribute [EditableFreeTextArea...]. If that attribute is remoevd the text field will disappear.

May 12, 2009 at 5:23 PM

I think the problem is that ContentItem or something similar is the base class that you are talking about. So people will want to keep this functionality for other Items, but in this particular case - disable the free text field, like overriding it etc. I think I mentioned this in a post a while ago and Cristian said he hadn't thought about people wanting to do this.

May 15, 2009 at 10:32 AM

Hey guys,

How about this:

        public override string Text
        {
            get { return null; }
            set { }
        }

Add that to the item you are creating, and you should be able to disable it's inheritted Text property.