Jump to content

Frontend form with tinymce or ckeditor module


pwFoo
 Share

Recommended Posts

Get working ckeditor (regular mode) with Processwire 2.5 in the frontend (jsConfig and JqueryCore is required!). 

To get the ckeditor loaded in inline mode it's important to not load JqueryCore! It won't work... 

After figured that out I noticed that the value isn't set correct .You get the default value every time!

["body"]=> string(8) ":IGNORE:" 

So the behavior of the ckeditor module is strange...

By the way... shouldn't be added JqueryCore as dependency to InputfieldCKEditor module? Because it won't work without. But JqueryCore will also kill ckeditor in inline mode...  :huh:

Can't test it with TinyMCE because each try to install it redirects to the ckeditor installation page. So it seems a bug in PW 2.5.

Get it...

Regular and inline mode works fine, but needs JqueryCore and JqueryUI modules be loaded

Link to comment
Share on other sites

  • 5 weeks later...

Hey guys, I've just found this great cms after using Wordpress and I am trying to get inline wysiwyg. Can someone please give me an idiots guide into how I input this into my theme. It's going to be hard enough learning a new software andi need the inline editing as soon as.

Thanks

Link to comment
Share on other sites

  • 5 months later...

Just wanted to note here that with PW 2.6.x the pwimage plugin stopped working. So I couldn't insert images in CKEditor anymore. I discovered that in the config json array with PW 2.6 a element "modals" got added (through /wire/config.php around line 848).

You need to add this to the $jsConfig like:

	<script>
	<?php
	$config = $this->wire('config');
	$jsConfig = $config->js();
	$jsConfig['modals'] = array(
		'large' => "15,15,30,30,draggable=false,resizable=true,hide=250,show=100", 
		'medium' => "50,49,100,100", 
		'small' => "100,100,200,200",
		'full' => "0,0,0,0",
	);
	$jsConfig['urls'] = array(
	    'root' => $config->urls->root,
	    'admin' => $config->urls->admin,
	    'modules' => $config->urls->modules,
	    'core' => $config->urls->core,
	    'files' => $config->urls->files,
	    'templates' => $config->urls->templates,
	    'adminTemplates' => $config->urls->adminTemplates
	);
	?>
	var config = <?php echo json_encode($jsConfig); ?>;
	</script>

Then the modal popups for inserting images will work again. See also my thread about pwimage plugin in frontend forms.

  • Like 1
Link to comment
Share on other sites

I found a cleaner way of adding modals to $jsConfig. Instead of writing out the whole array, we can do:

$jsConfig['modals'] = $config->modals;

This way also changes to the core get picked up.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...