How can I remove the WYSIWYG editor from some fields?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

How can I remove the WYSIWYG editor from some fields?

Post by stopsatgreen »

Hi,

In my News module I want to remove the WYSIWYG editor from the Summary field but keep it on the Story field. I'm pretty sure I have to remove it from the code manually - how can I do this?

I set the site up for some non-technical clients and they keep putting formatting in the Summary, which messes up the page design; if I can strip it out I think it will be easier for all concerned!
Oliver
Forum Members
Forum Members
Posts: 28
Joined: Wed Mar 15, 2006 9:50 pm
Location: Switzerland

Re: How can I remove the WYSIWYG editor from some fields?

Post by Oliver »

That's really simple. The [content] - tag in your template has got the option wysiwyg (true/false). Just turn it off there. You find this info in your admin panel under "Extensions" -> "Tags". Good luck.
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: How can I remove the WYSIWYG editor from some fields?

Post by stopsatgreen »

That's just for frontend editing, isn't it? Which page/template do I have to modify?
Oliver
Forum Members
Forum Members
Posts: 28
Joined: Wed Mar 15, 2006 9:50 pm
Location: Switzerland

Re: How can I remove the WYSIWYG editor from some fields?

Post by Oliver »

I have to realize that news templates are not as pretty as all other templates where my method would have worked...

Someone with programming skills is needed here!
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: How can I remove the WYSIWYG editor from some fields?

Post by stopsatgreen »

Can anyone point me in the direction of the file I need to alter the code, please?
cyberman

Re: How can I remove the WYSIWYG editor from some fields?

Post by cyberman »

Please change your template like this:

{content block='test' wysiwyg='false'}
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: How can I remove the WYSIWYG editor from some fields?

Post by stopsatgreen »

Um... no. I need to remove it from inside Admin; this isn't a frontend edit. I want to remove the option inside the News module, so the admin who enters the news doesn't have to use the WYSIWYG.
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: How can I remove the WYSIWYG editor from some fields?

Post by stopsatgreen »

Sorry to keep bumping this up... last time, I promise :)

If somebody could please explain to me which file I need to alter, I could try to work out the rest for myself...
Oliver
Forum Members
Forum Members
Posts: 28
Joined: Wed Mar 15, 2006 9:50 pm
Location: Switzerland

Re: How can I remove the WYSIWYG editor from some fields?

Post by Oliver »

If it were a regular page, in your admin you'd navigate to Layout > Templates, click on the template you're using for that page, look for a tag named {content} and change it to {content wysiwyg='false'}.

Unforturnately you are not dealing with a regular page but a news item. This means its layout is controlled by a special template. You can access this from your admin navigating to Content > News.

There you have a Summary Template and a Detail Template. Thats how far my help goes - unfortrunately I am no programmer and have no clue on how these templates are configured.
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: How can I remove the WYSIWYG editor from some fields?

Post by stopsatgreen »

Thanks everyone for the help, but I think I'm not making myself clear... I want to remove the WYSIWYG editor from INSIDE the Admin area; ie, login to Admin, go to Content > News and click on a news story to create it... I want to keep the WYSIWYG for the Content area, but remove it from the Summary. I know I can disable it in the Preferences, but that removes it from all fields. I want to know which file I need to alter in order for this not to appear as an option.
jah
Forum Members
Forum Members
Posts: 147
Joined: Thu Dec 30, 2004 9:09 am
Location: Norway

Re: How can I remove the WYSIWYG editor from some fields?

Post by jah »

I think what you are looking for is this:

In action.addarticle.php line 144 (in my version)

Change from:

Code: Select all

$this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
to:

Code: Select all

$this->smarty->assign('inputsummary', $this->CreateTextArea(false, $id, $summary, 'summary', '', '', '', '', '80', '3'));
do the same in action.editarticle.php line 168

Jon
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: How can I remove the WYSIWYG editor from some fields?

Post by stopsatgreen »

Exactly that!!! Thanks very much!
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: How can I remove the WYSIWYG editor from some fields?

Post by stopsatgreen »

I've upgraded to 0.13 and now changing this option to 'false' no longer seems to work. Does anybody have any idea why?

Me being stupid! I forgot to change the line in action.editarticle.php.
Last edited by stopsatgreen on Wed May 31, 2006 6:13 pm, edited 1 time in total.
Post Reply

Return to “CMSMS Core”