Page 1 of 1
[solved] Capitalized titles
Posted: Sat Nov 17, 2007 3:43 am
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

Re: Capitalized titles
Posted: Sat Nov 17, 2007 4:40 am
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.

Re: Capitalized titles
Posted: Sat Nov 17, 2007 5:43 am
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?
Re: Capitalized titles
Posted: Sat Nov 17, 2007 5:57 am
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}
Re: Capitalized titles
Posted: Sat Nov 17, 2007 5:58 am
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.
Re: Capitalized titles
Posted: Sat Nov 17, 2007 6:39 am
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.
Re: Capitalized titles
Posted: Sat Nov 17, 2007 6:52 am
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.
Re: Capitalized titles
Posted: Sat Nov 17, 2007 3:57 pm
by baresi
Thanx for the help, marking this as solved
