6

Under EE 1, I was able to hack the source to allow me to retain url titles with the exact case of the title. That is, I was able to keep it from forcing all url titles to be lower case.

I need to replicate the same behaviour on EE 2, but I am not quite managing so far.

What I have done so far is this:

In <system>/expressionengine/modules/channel/mod.channel_standalone.php:

commented out this line: NewText = NewText.toLowerCase();

added “A-Z” to this line: NewText = NewText.replace(/[^a-z0-9-_]/g,’‘);

In <system>/expressionengine/helpers/EE_url_helper.php:

removed strtolower() from this section:

  if ($lowercase === TRUE)
  {
  $str = strtolower($str);
  }

added “A-Z” to this line: [^a-z0-9\-\._]

I don’t know for sure if all of these changes were actually needed, but I think so. By the look of it, the changes to mod.channel_standalone.php should take care of any submissions via a stand-alone entry form and the changes to EE_url_helper.php should take care of regular postings.

It almost does, except for the live URL. The URL generated as I type a title is generated in lower case. However, if I delete it before I save the post, it saves the post with the same case in the url title as the title. At least, it does so most of the time. Sometimes, it does get saved with the lower case url.

If anyone might be able to tell me how to get the live URL title to co-operate as well, I would be very grateful.

Linda Antonsson
  • 283
  • 1
  • 7
  • that live url title is a javascript thing, with a decent text-editor you can search thru the whole EE or themes directory. – GDmac Nov 03 '12 at 23:40
  • I've been doing precisely that, but there must be something I am not catching. I've looked for instances of a-z09, strtolower and NewText.toLowerCase but I have not found any more instances than the above look that look relevant. I did find something in the codeigniter directory (another url helper function), but editing that had no effect. If it is done by a javascript, would there be any sort of standard class one could search for? – Linda Antonsson Nov 04 '12 at 00:34
  • Oh doh, just saw you suggested searching themes as well. Thank you, I had overlooked that. Will check! – Linda Antonsson Nov 04 '12 at 00:37

1 Answers1

5

This is happening in themes/javascript/compressed/jquery/plugins/ee_url_title.js.

It may be a bit difficult to find since the Javascript is compressed, but the expression you will want to edit is: a = (k + a).toLowerCase().replace(d, c);

Jeremy Worboys
  • 533
  • 3
  • 16
  • Thank you. :) I see that in the same script, there's also a section mention a-z09 as valid characters. Should I also add A-Z there or isn't that necessary? – Linda Antonsson Nov 04 '12 at 09:37