Setting page's title to be the News title

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

Setting page's title to be the News title

Post by gianpiero »

Hi all

I've just upgraded to 1.9.4.3 "Faanui"

I would like to manage my self into the modification as in Subject.
I know that the trick has been already discussed and developed.

I reached 2 suggestion as follow:

by Calguy
Showing Article Title in the Page Title
http://wiki.cmsmadesimple.org/index.php ... /Templates

by Goran
Setting your page's title to be the News title
http://www.i-do-this.com/blog/29/Settin ... News-title

Is there any big difference between two ways to do this ?

Any suggestion about ? Any tested ?

Thanks in advance for any reply

Gianpiero (Ita)
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Setting page's title to be the News title

Post by Wishbone »

gianpiero wrote:Showing Article Title in the Page Title
http://wiki.cmsmadesimple.org/index.php ... /Templates
The above is an older way to achieve this, though still perfectly valid. Previously, the template was processed in sequence, requiring that you capture the {content} in the <head>, so that the page title is known before <title> was used.
gianpiero wrote:Setting your page's title to be the News title
http://www.i-do-this.com/blog/29/Settin ... News-title
The above is the more modern way to do it. In the last several major versions, by default, the </__body> is processed before the <head>, so that titles set in the news detail template are available when the <head> is generated.
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

Re: Setting page's title to be the News title

Post by gianpiero »

Thank for your reply. :)
Asap I'll make the second mod
I'll giving feeback later

Bye
Gianpiero
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

Re: Setting page's title to be the News title

Post by gianpiero »

Sorry for buddy question:
this mod changes only the title on Browser Tab ?
The title of page, CMSMS field "Title" that appears into the template, is changed also ? ???

Thanks
Gianpiero
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Setting page's title to be the News title

Post by Wishbone »

I usually output the title in the News detail template, using:
<h1>{$entry->title}</h1>
Post Reply

Return to “CMSMS Core”