--
You received this message because you are subscribed to the Google Groups "Dotcms User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
Visit this group at http://groups.google.com/group/dotcms.
For more options, visit https://groups.google.com/d/optout.
As long as your DB is UTF8 and your system you should be able to type in your locale
On Tue, Oct 14, 2014 at 6:30 AM, Saadettin Yasir AKEL <yasi...@gmail.com> wrote:
Hi,I have to write russian news site. In the administration panel, russian works. I do not write news header (URL Title) with Russian characters. How do I set Russian characters?Thanks and regards
Christopher Falzone
Interactive Developer
A Q U E N T
Digital, Creative, and Marketing Talent
#set($cusFieldVarName="title")<script>
function updateDisplayURLTitle(){ // get the title entered by the user var plainTitle = dojo.byId("$cusFieldVarName"); if(plainTitle == undefined || plainTitle.value.length ==0){ dojo.byId("displayURLTitle").innerHTML = ""; dojo.byId("urlTitle").value=""; return; } // make a friendly url var urlTitle = plainTitle.value.toLowerCase(); urlTitle= urlTitle.replace(/^\s+|\s+$/g,""); urlTitle= urlTitle.replace(/ı/g, "i"); urlTitle= urlTitle.replace(/ğ/g, "g"); urlTitle= urlTitle.replace(/ü/g, "u"); urlTitle= urlTitle.replace(/ş/g, "s"); urlTitle= urlTitle.replace(/ö/g, "o"); urlTitle= urlTitle.replace(/ç/g, "c"); urlTitle= urlTitle.replace(/İ/g, "I"); urlTitle= urlTitle.replace(/Ğ/g, "G"); urlTitle= urlTitle.replace(/Ü/g, "U"); urlTitle= urlTitle.replace(/Ş/g, "S"); urlTitle= urlTitle.replace(/Ö/g, "O"); urlTitle= urlTitle.replace(/Ç/g, "C"); urlTitle= urlTitle.replace(/Х/g, "H"); urlTitle= urlTitle.replace(/ /g, "-"); urlTitle = urlTitle.replace(/[^a-zA-Z0-9-]/g , ""); urlTitle = urlTitle.replace(/\s/g, "-"); while(urlTitle.indexOf("--") > -1){ urlTitle = urlTitle.replace("--",'-'); } while(urlTitle.lastIndexOf("-") == urlTitle.length -1 ){ urlTitle=urlTitle.substring(0,urlTitle.length -1); } // set the values of the display place holder and the custom field // the is to hold the div open dojo.byId("displayURLTitle").innerHTML = urlTitle; dojo.byId("urlTitle").value=urlTitle; }
// attach this the text1 field onchange dojo.addOnLoad(function(){ dojo.connect(dojo.byId("$cusFieldVarName"), "onchange", null, "updateDisplayURLTitle"); } ); // populate the field on load dojo.addOnLoad(updateDisplayURLTitle);
</script><div id="displayURLTitle" style="height:20px"> </div>
urlTitle = urlTitle.replace(/[^a-zA-Z0-9-]/g , "");
Detail about the error did not appear. (Kivi Shapiro suggested it.) I deleted the code (urlTitle = urlTitle.replace(/[^a-zA-Z0-9-]/g , ""); ) in url-title.vtl. In this way, the error seems to be settled.
// make a friendly urlvar urlTitle = plainTitle.value.toLowerCase();urlTitle= urlTitle.replace(/^\s+|\s+$/g,"");urlTitle= urlTitle.replace(/ı/g, "i");urlTitle= urlTitle.replace(/ğ/g, "g");urlTitle= urlTitle.replace(/ü/g, "u");urlTitle= urlTitle.replace(/ş/g, "s");urlTitle= urlTitle.replace(/ö/g, "o");urlTitle= urlTitle.replace(/ç/g, "c");urlTitle= urlTitle.replace(/İ/g, "I");urlTitle= urlTitle.replace(/Ğ/g, "G");urlTitle= urlTitle.replace(/Ü/g, "U");urlTitle= urlTitle.replace(/Ş/g, "S");urlTitle= urlTitle.replace(/Ö/g, "O");urlTitle= urlTitle.replace(/Ç/g, "C");urlTitle= urlTitle.replace(/Х/g, "H");urlTitle= urlTitle.replace(/ /g, "-");urlTitle = urlTitle.replace(/[^a-zA-Z0-9-]/g , "");urlTitle = urlTitle.replace(/\s/g, "-");while(urlTitle.indexOf("--") > -1){urlTitle = urlTitle.replace("--",'-');}while(urlTitle.lastIndexOf("-") == urlTitle.length -1 ){urlTitle=urlTitle.substring(0,urlTitle.length -1);}
#set($currentAlphabet = "") ## No default alphabet: just URLencode everything
##set($currentAlphabet = "a-zA-Z") ## English alphabet
##set($currentAlphabet = "[\u0400-\u052F]") ## Cyrillic alphabet and supplement, per http://en.wikipedia.org/wiki/Cyrillic_script_in_Unicode
## For more Unicode code points, see http://kourge.net/projects/regexp-unicode-block
// make a friendly url
var urlTitle = plainTitle.value.replace(/\s+/g,"-"); // Replace whitespace with hyphens
urlTitle = urlTitle.replace(/-{2,}/g,"-"); // Replace sequences of hyphens with a single hyphen
urlTitle = urlTitle.toLowerCase(); // This line is optional. It does respect locale which is nice: the lowercase version of "I", for instance, is different in English and Turkish
#if($UtilMethods.isSet($currentAlphabet))
urlTitle = urlTitle.replace(/[^${currentAlphabet}0-9-]/g , ""); // Strip out everything other than letters in the current alphabet, digits, and hyphens
urlTitle = urlTitle.replace(/^-|-$/g,""); // Eliminate leading and trailing hyphens AFTER stripping
#else
urlTitle = urlTitle.replace(/^-|-$/g,""); // Eliminate leading and trailing hyphens BEFORE encoding
urlTitle = encodeURIComponent(urlTitle); // If no alphabet is specified then encode reserved ASCII characters and all non-ASCII characters
#end