IPB

Welcome Guest ( Log In | Register )

Movable Type

We're moving to movabletype.org!

At long last, we're moving to forums powered by, well, Movable Type itself. You'll want to bookmark http://forums.movabletype.org/ for future reference, and in the meantime you can view these old forums as a read-only archive of past posts. Thanks for being part of the community!

 
Reply to this topicStart new topic
> Force first-letter uppercase, not dirify, not upper_case, not...
losmadden
post Jun 28 2003, 10:19 AM
Post #1





Group: Members
Posts: 115
Joined: 6-February 03
From: Montevideo, Uruguay
Member No.: 7,622



There are ways to dirify a tag, to uppper_case it, and to lower_case it. Is there any way to force the first letter to be uppercase, but leave the rest of the word or phrase in lowercase? Make it like a sentence? I want to force conformity in some commenter values, some of which use only lowercase, some of which use sentence-capitalization, some of which might possibly use all caps.

Any ideas?
Go to the top of the page
 
+Quote Post
insameluise
post Jun 28 2003, 11:01 AM
Post #2





Group: Members
Posts: 16
Joined: 20-June 03
Member No.: 12,465



Eva Jagt Zwei Boxkämpfer Quer Durch Sylt

"capitalize" : every word begins in Uppercase

"uppercase": all word uppercase

CODE
<p style="text-transform : capitalize">Eva jagt zwei Boxkämpfer quer durch Sylt</p>
Go to the top of the page
 
+Quote Post
gvtexas
post Jun 28 2003, 11:53 AM
Post #3





Group: Members
Posts: 861
Joined: 30-April 03
From: Texas
Member No.: 10,425



You can achieve sentence case structure with the DirifyPlus plugin.

Cheers,
Gary


--------------------
Go to the top of the page
 
+Quote Post
kadyellebee
post Jun 28 2003, 01:35 PM
Post #4





Group: Members
Posts: 8,577
Joined: 11-October 01
From: Vancouver, WA
Member No.: 777



I was thinking that the Change Text Case plugin might do what you want, but now that I look at it closer, I'm not sure. That would be a nice addition to that plugin, though, so maybe let the author of the plugin know? smile.gif

Kristine


--------------------

start here - forum readme! | MT Wiki - FAQ

♥irtual ♥enus | mt-plugins | plugin manager (beta 0.1.8)
kdlb | collectics | love | blogplates ring | trk
blogstyles: easy to use stylesheets for MT blogs!
Need an easy answer? TypePad! Blog and hosting all in one!!
Go to the top of the page
 
+Quote Post
losmadden
post Jun 28 2003, 05:57 PM
Post #5





Group: Members
Posts: 115
Joined: 6-February 03
From: Montevideo, Uruguay
Member No.: 7,622



Thank you for the suggestions. From what I can tell, Dirifyplus comes closest (along with the CSS transformation) to doing what I want, but it seems to want to capitalize the first letter of every word. I don't see a way to let a phrase have just its first word capitalized. I think it will be good enough for now though. Thanks.
Go to the top of the page
 
+Quote Post
pixelmod
post Jan 11 2009, 04:28 PM
Post #6





Group: Members
Posts: 46
Joined: 2-February 08
Member No.: 52,314



Hello (maybe a little late).

QUOTE
Is there any way to force the first letter to be uppercase, but leave the rest of the word or phrase in lowercase?

I spent last weekend trying to resolve this problem. Searching here, there,, I found this 2 modifiers:

<$mt:PageTitle$ capitalize="1"> -> modifies the first char of each word of the phrase to Uppercase
<$mt:PageTitle$ upper_case="1"> -> modifies all chars the phrase to Uppercase

Then I discovered that if the site is published dynamically in php, php code can be inserted into the templates.

So, example:
CODE
<h1 id="page-title" class="asset-name"> <?php $title = '<$mt:PageTitle$>';echo ucfirst($title);?></h1>
--> Only first letter of title Uppercase.

But for the search result pages, whose URL is as follows: mt-search.cgi?blog_id=4&tag=tag&limit=20

the previous php code doesn´t works.. so investigating some javascript, I found this solution:
CODE
<h2 class="asset-name entry-title"><a href="<$mt:EntryPermalink$>" rel="bookmark"><$mt:EntryTitle$></a></h2>
            <script type="text/javascript">
            //<![CDATA[
               var x = document.getElementsByTagName('h2');
                
               for (var i=0;i<=x.length-1;i++)
               {
                  if (x[i].innerHTML == '<a href="http://domain.net/site-path/<$mt:EntryTitle$>/" rel="bookmark"><$mt:EntryTitle$></a>') {
                  
                     var newh2 = document.createElement("h2");
                    
                     newh2.className = "asset-name";
                    
                     var hyperlink = document.createElement("a");
                    
                     hyperlink.setAttribute("href", "<$mt:EntryPermalink$>");
                    
                     hyperlink.setAttribute("rel", "bookmark");
                    
                     var title = '<$mt:EntryTitle$>';
                    
                     title = title.slice(0,1).toUpperCase() + title.slice(1);
                    
                     var text = document.createTextNode(title);
                    
                     hyperlink.appendChild(text);
                    
                     newh2.appendChild(hyperlink);
                    
                     var previoush2 = x[i];
                    
                     previoush2.parentNode.replaceChild(newh2, previoush2);
                  }
               }
               //]]>
         </script>


regards




Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 11.24.09 - 10:50 PM