TinyMCE problems

Discuss everything related to ApPHP Restaurant Site script.

Moderators: ne_moj, alexmst, zewa, vadimako, ne_moj, alexmst, zewa, vadimako

kasumovic
Expert
Expert
Posts: 87
Joined: Sep 7th, '10, 22:38

TinyMCE problems

Postby kasumovic » Feb 21st, '14, 16:11

Hi,

I try to use some gallery to my page, but this dont work due some restrictions / bugs in TinyMCE

Following problems i have with build in TinyMCE edition :
- How can i tell TinyMCE to leave my html / php tags alone, and not enclose them with <p> </p> tags ?
- I can not use ALL html, php tags. How can i activate all of them ?

Code: Select all

in config.js inserting :
extended_valid_elements : "+*[*]",

Works, partial , means i can use TAGS but some properties are still blocked for example :

Code: Select all

<img class="group1" src="cm/content/ohoopee2.jpg" alt="Picture_1" width="250" height="180" />

It strips me "CLASS" propertie out. Seems to be some bug ?

Is possible to update this OLD TinyMCE to newest version ?

regards
Kasumovic

administrator
Site Admin
Site Admin
Posts: 5955
Joined: Jan 7th, '09, 23:18
Contact:

Re: TinyMCE problems

Postby administrator » Feb 24th, '14, 08:49

1. Open \js\vendors\tinymce\config.js, find there

Code: Select all

// Extended elements
extended_valid_elements : "iframe[src|width|height|name|align]",


and add here all tags and tags properties you want to allow.

Also see more information on tinymce site.

paragate
Master
Master
Posts: 151
Joined: Nov 13th, '14, 13:04
Location: Denmark, Odense

Re: TinyMCE problems

Postby paragate » Aug 19th, '16, 10:48

This probably resume for all TinyMCE WYSIWYG Editors
and why on pages/view it seems that TinyMCE WYSIWYG Editor are restricted to not more than 2 or three editors per page..?

administrator
Site Admin
Site Admin
Posts: 5955
Joined: Jan 7th, '09, 23:18
Contact:

Re: TinyMCE problems

Postby administrator » Aug 21st, '16, 06:50

Are you sure you give unique ID for each textarea?

paragate
Master
Master
Posts: 151
Joined: Nov 13th, '14, 13:04
Location: Denmark, Odense

Re: TinyMCE problems

Postby paragate » Aug 21st, '16, 11:00

Sorry, it worked up to 5 editors. tried with 5 setTinyMceEditor id set to input id. And it displays 5 editors in one view (pages/vied/edit)
Think it is the last attribute in the registerScript it must start with 1 and not 2 as it is set as default.
Lets say in the view/edit i have:
<div class="row">
<label for="page_header"><?php echo A::t('cms', 'Page Header'); ?>: <span class="required">*</span></label>
<input id="page_header" type="text" value="<?php echo CHtml::encode($pageHeader); ?>" name="page_header" class="large" maxlength="255">
</div>

<div class="row">
<label for="page_text"><?php echo A::t('cms', 'Page Text'); ?>:</label>
<div style="float:left">
<textarea id="page_text" name="page_text" class="full" maxlength="10000"><?php echo $pageText; ?></textarea>
</div>
<div style="clear:both;"></div>
</div>
<!--Nye felter kommer her-->



<div class="row">
<label for="section16_sub">
<?php echo A::t('cms', 'section16_sub'); ?>: <span class="required">*</span></label>
<input id="section16_sub" type="text" value="<?php echo CHtml::encode($section16_sub); ?>" name="section16_sub" class="large" maxlength="255">
</div>

<div class="row">
<label for="section16_head">
<?php echo A::t('cms', 'section16_head'); ?>: <span class="required">*</span></label>
<input id="section16_head" type="text" value="<?php echo CHtml::encode($section16_head); ?>" name="section16_head" class="large" maxlength="255">
</div>

<div class="row">
<label for="section15_text">
<?php echo A::t('cms', 'section15_text'); ?>:</label>
<div style="float:left">
<textarea id="section15_text" name="section15_text" class="full" maxlength="10000">
<?php echo $section15_text; ?>
</textarea>
</div>
</div>
A::app()->getClientScript()->registerScript('setTinyMceEditor', 'setEditor("page_text",'.(($errorField == 'page_text') ? 'true' : 'false').');', 1);
A::app()->getClientScript()->registerScript('setTinyMceEditor', 'setEditor("section16_sub",'.(($errorField == 'section16_sub') ? 'true' : 'false').');', 2);
A::app()->getClientScript()->registerScript('setTinyMceEditor', 'setEditor("section16_head",'.(($errorField == 'section16_head') ? 'true' : 'false').');', 3);
A::app()->getClientScript()->registerScript('setTinyMceEditor', 'setEditor("section15_text",'.(($errorField == 'section15_text') ? 'true' : 'false').');', 4);
A::app()->getClientScript()->registerScript('setTinyMceEditor', 'setEditor("page_header",'.(($errorField == 'page_header') ? 'true' : 'false').');', 5);


Return to “ApPHP Restaurant Site {developers/users}”