Jump to content
jsantari

CKEditor auto complete in link editing

Recommended Posts

When editing content with ckeditor and I want to add an external link in the content the link dialog is automatically putting http:// at the front of the link no matter what I do. Is there a way to disable this behavior?

Share this post


Link to post
Share on other sites

Just curious, if it is an external link, why would you want to remove the http:// ?

Edited by MindFull
typo

Share this post


Link to post
Share on other sites

You can change the network protocol, after http:// is added to your link. But http:// is better than nothing. ;)

Share this post


Link to post
Share on other sites

Sorry, should have clarified the why for this. I host clients on hostgator and back in the spring they changed a mod security rule on the server which causes any url with an http or https in it to throw a 403 forbidden error. So when you go to edit a link you have created it errors and the dialog displays the error. Only way to fix it is to get on support with HG go through a couple of levels and then get them to whitelist the domain for the security rule which is causing it (they don't tell you what it is). This is the url that crashes it: http://northernaire.com/webadmin/page/link/?id=1322&modal=1&href=http%3A%2F%2Fwww.vilaswi.com%2Foutdoor-fun%2Fcross-country-skiing-snowshoeing%2F

Take out the http on the call and it will load. I was going to look at trying to look at a way to hack something to get it to work on the output end.

Just a pain to have to go through the process of whitelisting for a new PW install.

Share this post


Link to post
Share on other sites
1 hour ago, jsantari said:

I host clients on hostgator and back in the spring they changed a mod security rule on the server which causes any url with an http or https in it to throw a 403 forbidden error.

That is insane. Maybe time to move to a new host.

  • Like 1

Share this post


Link to post
Share on other sites

Wow, that's strange that they would do something like that.

In ProcessPageEditLink.js, I see this

// avoid adding scheme if we already added it before and user removed it
			if ($this.attr('data-ignore') == domain) {
				// do nothing
			} else {
				$this.val('http://' + val);
				$this.closest('.InputfieldContent').find('.notes').text('http://' + val); 
				$this.attr('data-ignore', domain);
			}

So it looks like if you delete the http://  once or twice, it should stop auto-filling.

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AndZyk
      Hello,
      I am currently building a intranet which will be hosted on the local network of a company. This intranet has many links to files on their fileserver with the protocol file://.
      So for example the links look like this file://domain.tld/filename.ext
      When I try to insert such a link into a URL field, I get the error, that only the protocol http:// is allowed. When I try to insert such a link into a CKEeditor link, it gets stripped out. Is it possible to insert such links into the FieldType URL and CKEditor.
      I know that I could use a FieldType Text or insert a RewriteRule in the .htaccess file, but I am looking for a more elegant solution. 😉
      Regards, Andreas
    • By prestoav
      Hi folks.
      I'm building a Formbuilder form to create new advert pages in a marketplace. Formbuilder is ideal for this. I need to add a description field that allows text to be added with line breaks etc. so showing a CKEditor field would be ideal (i.e. exactly like the field I'm typing into right now)!.
      Does anyone know if it's possible to add a CKEditor field to the front end presentation fo a Formbuilder field, maybe via a module or such?
      Many thanks!
    • By Roberts R
      Hello.
      I never though about it before but when I insert image into CKeditor field I don't get ALT tag filled from image that has it. Do I have to do it manualy for inserted image or Im doing something wrong?
       
    • By Robin S
      If you've ever needed to insert links to a large number of files within CKEditor you may have found that the standard PW link modal is a somewhat slow way to do it.
      This module provides a quicker way to insert links to files on the page being edited. You can insert a link to an individual file, or insert an unordered list of links to all files on the page with a single click.
      CKEditor Link Files
      Adds a menu to CKEditor to allow the quick insertion of links to files on the page being edited.

      Features
      Hover a menu item to see the "Description" of the corresponding file (if present). Click a menu item to insert a link to the corresponding file at the current cursor position. The filename is used as the link text. If you Alt-click a menu item the file description is used as the link text (with fallback to filename if no description entered). If text is currently selected in the editor then the selected text is used as the link text. Click "* Insert links to all files *" to insert an unordered list of links to all files on the page. Also works with the Alt-click option. Menu is built via AJAX so newly uploaded files are included in the menu without the page needing to be saved. However, descriptions are not available for newly uploaded files until the page is saved. There is an option in the module config to include files from Repeater fields in the edited page. Nested Repeater fields (files inside a Repeater inside another Repeater) are not supported. Installation
      Install the CKEditor Link Files module.
      For any CKEditor field where you want the "Insert link to file" dropdown menu to appear in the CKEditor toolbar, visit the field settings and add "LinkFilesMenu" to the "CKEditor Toolbar" settings field.
       
      http://modules.processwire.com/modules/cke-link-files/
      https://github.com/Toutouwai/CkeLinkFiles
    • By Guy Incognito
      Hi all,
      Having a strange problem with my CKeditor custom styles.
      Trying to add standard bootstrap classes to the image alignment options. But for some reason if I add multiple classes to the centred image option it disappears from the editor drop down. But with only one class it works.
      So this works:
      { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'float-md-left img-fluid' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'float-md-right img-fluid' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'img-fluid' } }, But this doesn't:
      { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'float-md-left img-fluid' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'float-md-right img-fluid' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'w-100 img-fluid' } }, Note the slight difference to the last line.
      I've tried escaping the hyphens in case it was that but doesn't help.
      Any ideas.... #puzzled!
×
×
  • Create New...