[solved] Capitalized titles

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
baresi
Forum Members
Forum Members
Posts: 129
Joined: Fri Jul 27, 2007 4:15 pm

[solved] Capitalized titles

Post by baresi »

Newbie question I guess, I searched but I must have wrong search terms.

I have this in my template
{sitename} - {title}
I enter the title as all lower case when adding content but want the HTML head title to be capitalized, is the solution a UDT? If so what should be the code for it? Thanx :)
Last edited by baresi on Sat Nov 17, 2007 3:57 pm, edited 1 time in total.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: Capitalized titles

Post by kermit »

uppercase:

{title|upper}

ref: http://smarty.php.net/manual/en/languag ... .upper.php

also..

lowercase:

{title|lower}

ref: http://smarty.php.net/manual/en/languag ... .lower.php

capitalized:

{title|capitalize}

ref: http://smarty.php.net/manual/en/languag ... capitalize


although....
i would recommend inputting content *correctly* into cmsms (i.e. capitalized properly) and then if you want all lowercase on a page, use CSS to do that....

h2 {text-transform:lowercase;}

why? if and/or when you change your mind.. you don't have to back and re-edit every single page title in cmsms.  and.. your former English teachers won't haunt your dreams for your using poor capitalization. ;)
Last edited by kermit on Sat Nov 17, 2007 4:49 am, edited 1 time in total.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
baresi
Forum Members
Forum Members
Posts: 129
Joined: Fri Jul 27, 2007 4:15 pm

Re: Capitalized titles

Post by baresi »

More really newbie stuff, sorry :)
I think I have to read up on how to use smarty, simply replacing {title}-->{title|capitalize} is not what I should be doing because that doesn't work. I have to use $title|capitalize somehow?

Couple of more things comes to mind:

I mean the page title in the head of HTML, not inside the body.
I create a new page in cmsms and call it 'group' (lets say I am keeping all lowercase) but I want the title to be 'Group', I guess any solution like the one you gave me won't matter if I have a page called 'group_five' or 'groupfive' and want it 'Group Five' in title?
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: Capitalized titles

Post by kermit »

thegrb wrote: More really newbie stuff, sorry :)
I think I have to read up on how to use smarty, simply replacing {title}-->{title|capitalize} is not what I should be doing because that doesn't work. I have to use $title|capitalize somehow?

Couple of more things comes to mind:

I mean the page title in the head of HTML, not inside the body.
I create a new page in cmsms and call it 'group' (lets say I am keeping all lowercase) but I want the title to be 'Group', I guess any solution like the one you gave me won't matter if I have a page called 'group_five' or 'groupfive' and want it 'Group Five' in title?

the smarty language modifiers work.. see attached (from cmsms 1.2).

if you want to go from "group_five" to "Group Five" -- that is more than simple capitalization, you're also replacing characters. smarty isn't going to be smart enough to know what characters to capitalize or where to break words if you're runningeverythingtogether, either.

it makes no difference WHERE you're using {title} -- template (anywhere in it), page content, whatever.... it will output the current page title.

note... it's {title|modifer} NOT {$title|modifier}
Attachments
smarty-language-modifiers.gif
Last edited by kermit on Sat Nov 17, 2007 6:02 am, edited 1 time in total.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Capitalized titles

Post by calguy1000 »

As kermit said, Page titles and menu text doesn't have to be in alias form, like first_last, the page alias takes care of that.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
baresi
Forum Members
Forum Members
Posts: 129
Joined: Fri Jul 27, 2007 4:15 pm

Re: Capitalized titles

Post by baresi »

Thanx for the quick help.
I want to ask about something I just tried and added in a test template. Must be illegal code-wise but the page created seems to work

{sitename} - {content block='titleuc'}

Its like adding a sort of a dummy title only seen in the generated page.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Capitalized titles

Post by calguy1000 »

No, that looks perfectly valid.

though I'd change it to:

{sitename} - {content block='titleuc' oneline='true'}

so that you only get a one line text input field to fill in when editing the page.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
baresi
Forum Members
Forum Members
Posts: 129
Joined: Fri Jul 27, 2007 4:15 pm

Re: Capitalized titles

Post by baresi »

Thanx for the help, marking this as solved :)
Post Reply

Return to “Layout and Design (CSS & HTML)”