Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hello,

I am having problems with the richtext editor that you use for Couch, if I can get everything to work, then that would be great and I'd be prepared to pay a license fee.

Firstly, with CKEditor, when the user types in a code block.

Code: Select all
Such as like this one


It doesn't work, as I see CKEditor does not have a code block editor in place, I tried to add a plugin called http://ckeditor.com/addon/pbckcode but this then hid the richtext editor in the admin panel and gave up an init javascript error, upon searching Google I found a bug report for the same problem and the creator said it was a 'language issue', but unfortunately I've been unable to fix it, possibly due to Couch being the problem due to the CKEditor version used and not CKEditor itself?

With CKEditor, another problem is tables, when a user inputs tabular data, the website is meant to be responsive, is there any way that the table can be made responsive?

I'm using Foundation for a responsive grid, when the user puts in an image via CKEditor, they have to remove the height and width of the image so that Foundation can control it, is it possible to do this by default rather than using the images height and widths?


Fixed by adding in a clearfix to clear floats -
With the contact form on the Blog (Followed the tutorial for this one), below it I have "More Like This", showing the latest three blog posts, when the user clicks submit, these three blog posts end up hidden for some reason, why could this be?

Another problem I am coming across is enabling prettyURL's, as the production server is running NGINX, how do I go about doing this, as in order to do it I need to enable mod rewrite on Apache, but NGINX doesn't have such thing, any help would be greatly appreciated. :)

Thank you.
Hi and welcome @problemguy :)

Disregarding for the moment whether you can get the PBCKCode script working as it should, I don't believe Couch's type='richtext' 'custom_toolbar' parameter even allows custom buttons to be input. Perhaps @KK can comment on this further.

I'm not sure what your definition of a responsive table is, but you can control the table dimensions by right-clicking on it and then clicking 'Table Properties'. If you want your front-end CSS to determine the table dimensions, then remove any width or height settings in the CKEditor dialog that pops up. The same applies when inserting an image, remove the width and height data that CKEditor populates.

Alternatively, on the front-end you could use a CSS style which would override any of these inline styles:
Code: Select all
table, img {
    width: auto !important;
    height: auto !important;
}

I'll defer to @KK on the Pretty URLs issue.
Disregarding for the moment whether you can get the PBCKCode script working as it should, I don't believe Couch's type='richtext' 'custom_toolbar' parameter even allows custom buttons to be input. Perhaps @KK can comment on this further.

Well, actually it does allow custom buttons but makes no guarantee if that messes up the existing contraption so I chose to skip documenting it :)

@problemguy
I tested out PBCKCode with CKEditor 4 and it seems to be working well.
I'll outline the procedure I followed -
1. Download the plugin from https://github.com/prbaron/PBCKCode/archive/v1.1.0.zip#
2. IMP. rename the extracted folder to 'pbckcode'
3. Place the folder in 'couch/includes/ckeditor/plugins'
4. Add the highlited line to 'couch/includes/ckeditor/config.js'
config.defaultLanguage = 'en';
config.extraPlugins = 'pbckcode';

5. Now we are ready to add the 'pbckcode' button to 'custom_toolbar' of ricktext editable region.
I'll give the simplest example (feel free to use your own) -
<cms:editable
name='test'
type='richtext'
toolbar='custom'
custom_toolbar='bold, italic, #pbckcode'
/>

Please notice that we are prefixing the 'pbckcode' button with a '#'. This is important as this signals Couch to incorporate an entity unknown to it.

Please let me know if this helps.

As for the .htaccess problem you mentioned, I'll get back to it shortly.
Thanks.
@problemguy

Coming to the URL rewite issue with nginx,
instead of .htaccess, nginx will require adding the directives to its main configuration file (nginx.conf usually found at '/etc/nginx').

The syntax of the rules is also significantly different than what is used by mod_rewrite of Apache but, I think, one of the following tools should convert our generated .htaccess to the proper nginx format -
http://www.anilcetin.com/
http://winginx.com/htaccess


After modifying the configuration file, you might need restarting the service.

I've not tested out the changes personally so if in case you run into problems (and if it is acceptable) please PM me your site's access creds. I'll try to get it working.

Thanks
Thank you @cheesypoof for the help, I'll try that out. :)

And to @KK, unfortunately I had already tried those steps, and I still get the Javascript error -

Code: Select all
Uncaught TypeError: Cannot read property 'addCode' of undefined plugin.js?t=C3HA5RM:34
CKEDITOR.plugins.add.init plugin.js?t=C3HA5RM:34
(anonymous function) ckeditor_v363b.php?t=C3HA5RM:25
t ckeditor_v363b.php?t=C3HA5RM:23
u ckeditor_v363b.php?t=C3HA5RM:23
v ckeditor_v363b.php?t=C3HA5RM:23
(anonymous function) ckeditor_v363b.php?t=C3HA5RM:23


According to firefox, this problem is due to line 34 of plugin.js, which says -

Code: Select all
label : editor.lang.pbckcode.addCode,


Any idea what this could be? I deleted my files and redid it again with those you posted, and followed your steps, and got the same result. I don't understand what could be the problem compared to your setup.

And I'll give the .htaccess with NGINX thing a try after I figure out this plugin problem. :)
The problem it seems is that you are using an older version of CKEditor.
Please upgrade to the v4 of it available for download from the 'Product updates' section of this forum.
(I am posting this via my mobile so please excuse the brevity)
KK wrote: The problem it seems is that you are using an older version of CKEditor.
Please upgrade to the v4 of it available for download from the 'Product updates' section of this forum.
(I am posting this via my mobile so please excuse the brevity)


That's great! The update now shows the CKEditor, however, now obviously since I'm using the custom toolbar, do you know of anywhere, or how, I would go about putting in all of the original contents of the toolbar? As in, I want all of the original toolbar as well as this custom pbckcode. I've looked in the documentation of CKEditor 4, but I can't seem to find a list of all possible toolbar things, such as center text, heading dropdown menu, (what comes standard with Couch in other words).

Thank you for the great help. :D
Please take a look at
http://www.couchcms.com/docs/tags-refer ... htext.html
- specifically the 'custom_toolbar' section.

N.B. Please remember the '#' I mentioned in the example in my earlier post
<cms:editable
name='test'
type='richtext'
toolbar='custom'
custom_toolbar='bold, italic, #pbckcode'
/>

Hope this helps :)
KK wrote: Please take a look at
http://www.couchcms.com/docs/tags-refer ... htext.html
- specifically the 'custom_toolbar' section.

N.B. Please remember the '#' I mentioned in the example in my earlier post
<cms:editable
name='test'
type='richtext'
toolbar='custom'
custom_toolbar='bold, italic, #pbckcode'
/>

Hope this helps :)

Ah yes, that got it working, thank you. :)

I tried what you said for the NGINX pretty URL's, and it finds the correct URL, as in /blog/this-is-a-blog-post rather than /blog?p=4 for example, but it doesn't show the page, it displays a 500 Internal Server Error, it's also messed up some Javascript that is within <script> tags on the page.

I have PM'd you about allowing you access to the server if you don't mind fixing it.

Thank you.
9 posts Page 1 of 1
cron