Hi there.
Movable type automatically fills the Basename field while writing the title of an entry. I want to know that how can I have some other characters to be written automatically while writing that character in the Title field. I think this capability is brought by a javascript file, but I don,t know how and where to edit.
Would you please help me?!
Reported on Movable Type 5

Hi Afshin,
The function involved on that is called rebasename.
You could find it under:
/tmpl/cms/edit_entry.tmpl
Kind Regards,
Mihai Bocsaru
----------------------------------
Daily Movable Type Consultant
Web Development
Movable Type Consulting
Six Apart Partner
http://www.pro-it-service.com/
----------------------------------
Movable Type Demo
http://www.movabletypedemo.org/
----------------------------------
Open Melody Demo
http://www.openmelodydemo.org/
I just want to add support for some unicode characters.
I had the same situation with my own written code in PHP and Javascript. Of course, it has been solved using the code below :
<script type="text/javascript"> function autofill() { var str = addpage.pageTitle.value; str = str.replace(/[^آ-یa-zA-Z0-9]+/g,'-'); addpage.pageBasename.value= str; } </script>I mean by adding "آ-ی" beside a-zA-Z0-9 .
now I just faced with :
trimmed = dir_title.match(/^(.*[^_])/);
What should I change here?!
I just changed trimmed = dir_title.replace(/[^Ø¢-ÛŒa-zA-Z0-9]+/g,'-');
But, no changes!
So, what should I do now?! Any suggestions ?!
Look into the source of the edit screen, you'll find the function:
function rebasename(title) { if (!orig_basename) { dir_title = dirify(title.value); dir_title = dir_title.substring(0, 100); trimmed = dir_title.match(/^(.*[^_])/); if (trimmed && trimmed.length) { setElementValue('basename', trimmed[0]); } else { setElementValue('basename', ''); } } }It is defined in this template: [Your MT directory]/tmpl/cms/edit_entry.tmpl which you can either hack directly (quick but dirty) or change on the fly by writing a plugin (longer but will work seamlessly across MT versions).
I would encourage you to create a feature request on Six Apart's bug tracker and ask for an option to have Unicode basenames rather than ASCII ones. I'm sure the Japanese would understand the need for them too. ;-)
Of course I don't know anything about Javascript and the method of writing a plugin for movable type. Using some available codes on the net, I could change a Javascript code in my own PHP code.
But, as I did the same thing to the code in /tmpl/cms/edit_entry.tmpl , nothing happened. If it's possible help on changing the code. It's an urgent need.
And of course, what is the way to create a feature request on Six Apart's bug tracker? Where should I ask them to do this for me?!
Hi Afshin,
You could create a feature request from:
http://bugs.movabletype.org/
Kind Regards,
Mihai Bocsaru
----------------------------------
Daily Movable Type Consultant
Web Development
Movable Type Consulting
Six Apart Partner
http://www.pro-it-service.com/
----------------------------------
Movable Type Demo
http://www.movabletypedemo.org/
----------------------------------
Open Melody Demo
http://www.openmelodydemo.org/
Thank you very much. I'm going to have a request for this issue in Six Apart's bug tracker.
But is there a way to change the Javascript code for now?! I need it immediately. Any help is really appreciated.
You're welcome!
You could change the JS function in the file that I've indicated you and then upload it to the server, so that the modified one overwrites the default.
You may also like to further define how you would like to change that. Because if you just want to add something else to the basename you could do that from the Entry archive template, adding the extra string to the archive mapping pattern.
Of course, I want to make it capable of supporting 32 letters from another language which it's possible by adding آ-ی like a-z or A-Z in Javascript. The problem is here that even by removing that function, I mean "function rebasename(title)", and saving it, No changes happen and everything is like before removing it!
Afshin,
I'm looking at MTOS 5.12 edit_entry.tmpl. It looks to me that the dirify function (in the rebasename(title) block) is what you need to replace with your own function:
dir_title = dirify(title.value);
That occurs at line 826 in MTOS 5.12.
I don't think you have to modify or replace the "trimmed" function.
OK, that's a 3 month old topic I just replied to. :(
Thanks for sharing this information.. spence @
payday loans toronto - http://www.redleafloans.ca/payday-loans-toronto.aspx
Slip rings rely on elastic overlap principle, and the rolling lap principle selection as a whole, constitute a reliable rotation connectivity system. As long as the slip ring attached to the infinite rotating equipment, it can provide power energy to the rotating body. So that the rotating body while unlimited rotational movement, but also for other sports, or detect the working conditions in the normal rotation state.
electrical slip ring is slip ring can transmit power and signal.
This is nice information. Thanks for sheering this