Hi,
I am using rules and a php code to create folders on the server on node creation. My input is the node title, which is names like "Tümer Alkoç" or "Tümer Ali Alkoç".
I need these inputs to be...
a) converted to all lower case.
b) spaces replaced with an underscore ( _ ).
c) accented characters to be latinized.
so the output would read "tumer_alkoc" and "tumer_ali_alkoc"
I believe if I can use one of the Transliteration module functions in my code properly I can achieve this. But I dont know how. I read the documentation and tried a couple of things but I am not a coder and couldnt find the right way to do it.
My php code that I want it to be transliterated is very simple as below.
<?php
$path = "sites/default/files/$node->title";
mkdir($path);
?>
Can someone please help me how to do it....
Comments
Comment #1
Alan D. CreditAttribution: Alan D. commentedThis should work, if not reopen (marking fixed will close this issue in 2 weeks).
Note:
1) I have assumed that the sites default file storage is public and this resides in "sites/default/files"
2) The function transliteration_clean_filename() is from the Transliteration module, all other functions are core Drupal.
Comment #3
MediaFormat CreditAttribution: MediaFormat commentedJust what I needed!
Thanks