4

Is there any way of forcing EE to remove 'dots' from the url title? As in an entry called "thiscompany.com" I want the url title to be thiscompanycom because other things depend on not having dots and it generally is bad practice to have it in the url (browser gets confused)

I tried this in the config file:

$config['permitted_uri_chars'] = 'a-z 0-9~%:_\-';

but the system won't override what seems to be a code ignitor default.

So my question is, where do I override this in the CI core if necessary, or some other way of doing it?

1 Answer 1

6
  1. You can use any ee add-ons which can create url_titles from another field (for example - MX *Title Control) + somethink like low_replace to remove dot's.

  2. You can replace it on JS level, you can use Foreign Character Extension

  3. You can make your own ext. using entry_submission_start hook.

  4. If you decide to hack core: \expressionengine\helpers\EE_url_helper.php, line 59 function url_title, after

    $trans = array(
                    '&\#\d+?;'              => '',
                    '&\S+?;'                => '',
                    '\s+'                   => $replace,
                    '[^a-z0-9\-\._]'        => '',
                    $replace.'+'            => $replace,
                    $replace.'$'            => $replace,
                    '^'.$replace            => $replace,
                    '\.+$'                  => ''
                );
    

just add new line

 $str = str_replace('.', '' , $str);
6
  • This doesn't help anyone logging into the admin panel and adding an entry. I know they can change this as they see it, but you would be surprised what people do, and I would rather just override it if possible from the core level.
    – Aaron
    Nov 27, 2013 at 10:25
  • how they can do this if url_title will be hided? I'm not sure if they decide to unhided using debug tools. If you afraid of this - make a simple ext. for entry_submission_start hook. Better then edit core.
    – Max Lazar
    Nov 27, 2013 at 10:55
  • If you decide to hack a core - I just update my answer
    – Max Lazar
    Nov 27, 2013 at 11:02
  • I just made this change in the CI core, but it still allows me to add a company.com url title to the entry?
    – Aaron
    Nov 27, 2013 at 12:06
  • 1
    sorry, I miss, that CI helpers is overwrite with EE - \expressionengine\helpers\EE_url_helper.php (i just tested it, so it's works)
    – Max Lazar
    Nov 27, 2013 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.